Quantcast
Viewing all articles
Browse latest Browse all 79901

Error merging contacts using MergeRequest

We have a workflow, and as part of it there are contacts getting merged. We use MergeRequest. There are custom fields on the contact entity. The merge throws an error with the name of the field causing the problem, but this is not one of our custom fields.

"Cannot specify child attributes in the columnset for Retrieve. Attribute: transactioncurrencyidname"

We filtered out this field so it would not be merged, but still see the same error on the same field.

 

            var fields = GetFieldsToMerge(service);

            var fieldNames = fields.Select(x => x.LogicalName).ToArray();

            var masterContactReference = MasterContactReference.Get<EntityReference>(executionContext);

            var masterContact = service.Retrieve(masterContactReference.LogicalName, masterContactReference.Id, new ColumnSet(fieldNames));

 

            var pendingReference = PendingContactReference.Get<EntityReference>(executionContext);

            var pendingContact = service.Retrieve(pendingReference.LogicalName, pendingReference.Id, new ColumnSet(fieldNames));

 

            var merge = new MergeRequest

            {

                SubordinateId = pendingContact.Id,

                Target = masterContactReference,

                UpdateContent = masterContact

            };

 

            var merged = (MergeResponse)service.Execute(merge);

 

 


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>