private void QueryRelatedRecords()
        {
            WorkAsync("Querying Related Entities for Selected Row from Step 4",
                e => // Work To Do Asynchronously
                {
                    var fetchXmlBuilder = new RelatedEntityQueryBuilder();
                    var formEntryReader = new FormEntryReader(fetchXmlBuilder);
                    formEntryReader.ReadEntitySelected(entityDropdown);
                    formEntryReader.ReadUniqueIdentifierAttributes(entityAttributeView);
                    formEntryReader.ReadFilterValuesFromSelectedRow(duplicatesGrid);
                    formEntryReader.ReadRelatedEntitySelected(relationShipDropdown);
                    fetchXmlBuilder.AddColumn(new CrmEntityAttribute("createdon", "DateTime"));
                    var response = GetRecordsFromCrm(fetchXmlBuilder.GetOutput());

                    var reader = new FetchXmlResponseReader(response);
                    var dataset = reader.ParseRelatedRecords(fetchXmlBuilder);
                    SafeSetDataSource(relatedEntityGrid, dataset);

                    e.Result = "Step 6 Record View Updated";
                }, e =>
                {
                    MessageBox.Show(e.Result as string);
                });
        }
        private void QueryRecords()
        {
            WorkAsync("Querying Records for Selected Rows from Step 4",
                e => // Work To Do Asynchronously
                {
                    var fetchXmlBuilder = new EntityQueryBuilder();
                    var formEntryReader = new FormEntryReader(fetchXmlBuilder);
                    formEntryReader.ReadEntitySelected(entityDropdown);
                    formEntryReader.ReadUniqueIdentifierAttributes(entityAttributeView);
                    formEntryReader.ReadFilterValuesFromSelectedRow(duplicatesGrid);
                    formEntryReader.ReadDisplayAttributes(entityAttributeView);
                    var response = GetRecordsFromCrm(fetchXmlBuilder.GetOutput());

                    var reader = new FetchXmlResponseReader(response);
                    var dataset = reader.ParseEntityQueryResponse(fetchXmlBuilder);
                    SafeSetDataSource(entityRecordGrid, dataset);

                    e.Result = "Step 5 Record View Updated";
                }, e => MessageBox.Show(e.Result as string));
        }