Reputation: 11
I am trying to migrate quote details using the Kingswaysoft SSIS CRM migration package from CRM2016 on premise to D365.
To read the data I am using Fetch XML, on the quotedetails entity and want to link to the quote entity to retreive quotenumber and revisionnumber.
My current query looks like the following -
<fetch mapping='logical'>
<entity name="quotedetail">
<attribute name="baseamount" />
<link-entity name="quote" from="quoteid" to="quoteid" link-type="inner" alias="quote">
<attribute name="quotenumber" />
<attribute name="revisionnumber" />
<filter>
<condition attribute='revisionnumber' operator='eq' value='1'/>
</filter>
</link-entity>
</entity>
</fetch>
Using the data viewer shows that all values in the linked entity are returned as null, and therefore I cannot use these as a lookup for the quoteid.
Using this FetchXML statement in XRMtoolbox however does show the fields correctly.
Upvotes: 1
Views: 763
Reputation: 1203
According to KingswaySoft official "Known Limitation", this is a known issue with a workaround:
In the CDS/CRM Source Component, with the FetchXML option, if you are using linked entities in your FetchXML queries, the CRM component returns NULL values for the fields from linked entities. To avoid this, provide an alias for each linked entity.
I.e. you should provide an alias in the FetchXML to avoid this issue. I got it working in my case by providing the alias on the attribute, meaning you would have to do the following:
<fetch mapping='logical'>
<entity name="quotedetail">
<attribute name="baseamount" />
<link-entity name="quote" from="quoteid" to="quoteid" link-type="inner">
<attribute name="quotenumber" alias="quote_quotenumber"/>
<attribute name="revisionnumber" alias="quote_revisionnumber" />
<filter>
<condition attribute='revisionnumber' operator='eq' value='1'/>
</filter>
</link-entity>
</entity>
</fetch>
Upvotes: 0