I have a salesorder with a lookup to a lead. When viewing the sales order, I can clearly see and click to follow the lookup to the lead. On that lead, I can clearly see and click to follow the lookup to the source campaign.
However, the following fetch XML returns that sames Sales Order and will not recognize that the Source Campaign is actually present. I've also tried using a link entity in FetchXML builder and the link fails as well, even though the lookup is definitely populated.
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="salesorder">
<attribute name="name" />
<attribute name="customerid" />
<attribute name="statuscode" />
<attribute name="totalamount" />
<attribute name="salesorderid" />
<attribute name="createdon" />
<order attribute="name" descending="false" />
<link-entity name="lead" from="leadid" to="xxx_leadid" link-type="inner" alias="ad">
<attribute name="lastname" />
<attribute name="firstname" />
<attribute name="createdon" />
<attribute name="campaignid" />
<filter type="and">
<condition attribute="campaignid" operator="null" />
</filter>
</link-entity>
</entity>
</fetch>
If you notice, the references to the first and last name of the lead works.
And the lead with the source campaign set.
*This post is locked for comments