I'm building a report for my CRM app and need to figure out how to write the FetchXML statement. I have two custom entities in a parent-child relationship. I need to select all fields from both parent and child entities but for the child entity I only want to retrieve the latest record. I have seen examples of how to achieve this using "groupby" and "aggregate" clauses but they only bring back the date column. How do I fetch all the columns in the child entity?
Hi,
It cannot be achieve by fetchXML only. "groupby" and "aggregate" can only show the column which has been set with "aggregate".
Here is an example to show the contacts of the accounts order by the account ids and the create date of contacts.
Here is the solution used by the poster.
reporting services - Auto numbering to parent and child columns - Stack Overflow
If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.
Best Regards,
Nya