How can I create a fetchXML query which will retrieve only the top row from a linked-entity?
I have a situation in which I want a report which shows Account and the last Opportunity Closed regarding account, ie in fetchXML i'm trying something like:
<fetch distinct="false" no-lock="false" mapping="logical"><entity name="account" enableprefiltering="1" prefilterparametername="CRM_FilteredAccount"><attribute name="name" alias="name" /><attribute name="customertypecode" alias="customertypecode" /><attribute name="address1_city" alias="address1_city" /><attribute name="industrycode" alias="industrycode" /><attribute name="accountid" /><link-entity name="opportunity" to="accountid" from="parentaccountid" link-type="outer" alias="opportunity1" enableprefiltering="1" prefilterparametername="CRM_FilteredOpportunity"><attribute name="new_partnername" alias="opportunity1_new_partnername" /><attribute name="name" alias="opportunity1_name" /><attribute name="new_microsofttechnologies" alias="opportunity1_new_microsofttechnologies" /><attribute name="createdon" /><attribute name="actualclosedate" alias="opportunity1_actualclosedate" /><order attribute='actualclosedate' descending='true' /><attribute name="opportunityid" /></link-entity></entity></fetch>
*This post is locked for comments