We are trying to get entity ID when synchronizing Dynamics 365 entities into Sitecore 9.0.1 using Sitecore Connect for Microsoft Dynamics 365 for Sales 2.0.1 module. What is the best solution? We are getting currently Microsoft.Xrm.Sdk.EntityReference as value instead of ID. Can we get also other properties from the referenced entity like emailaddress and so on. We are trying to sync Cases and corresponding Customer field (and its id or email address).

In Dynamics 365: enter image description here

In Sitecore:

enter image description here

1 Answer 1


In order to get customer id you have to change your accessor template to

enter image description here

It should be something like this

enter image description here

And if the value Guid type you can use transformer Guid to String.

  • I tried using the solution above, but I get an error message on batch pipeline saying the the 'Sample' entity doesn't contain attribute with Name 'Sample Attr' the 'Sample Attr' is a from the related entity. Commented Jul 2, 2019 at 6:26
  • Probably the attribute name is sampleatt or something similar. You need to go to Entity definition and in Field definition take Name field not Display Name -> ramontebar.net/2017/09/13/dynamics-365-attribute-name-lengths Commented Jul 2, 2019 at 6:32
  • <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true"> <entity name="account"> <attribute name="name" /> <attribute name="accountid" /> <order attribute="name" descending="false" /> <link-entity name="sample_Related" from="sam_account" to="accountid" link-type="inner" alias="aa"> <filter type="and"> <condition attribute="SampleAttr" operator="not-null" /> </filter> </link-entity> </entity> </fetch> here is my sample XML and im tryong to get it from a link-entity attribute name. SampleAttr Commented Jul 2, 2019 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.