I have a requirement to fetch records in report such that if a record has child transactions need to consider sum of amount of child transactions of that record else need to consider sum of amounts of parent transactions. How can i implement the same using fetch xml ? Since i am using crm online custom code would also not work out. any help is much appreciated. I have been searching for a long time for any work around even but could find any luck..
*This post is locked for comments
First, you should download Xrmtoolbox and test your fetch query using FetchXML Builder plugin from xrmtoolbox, below is the website to download xrmtoolbox.
In dynamic 365, account and contact has parent child relationship so lets use that as an example
<fetch top='20' >
<entity name='account' >
<attribute name='name' />
<filter type='or' >
<condition attribute='accountnumber' operator='eq' value='t1' />
</filter>
<link-entity name='contact' from='accountid' to='accountid' >
<attribute name='fullname' />
</link-entity>
</entity>
</fetch>
You might want to also add sort statement based on how you define "top 20" (such as by age, by highest sales, etc.) . You will need to modify t1 as input parameter, in CRM, your user can select both T1 and T2 and use run reports and get the result that you want. This will give you top 20 child record based on your parent record input.
Once you have your query, you need to setup your visual studio so that it can make SSRS report for Dynamic 365 (it only works with VS2015 or below for now), below is a guide that can help you with VS.
Also i need to find top 20 so if i do not apply over query i would not get correct output
Thanks for the reply Tyler, but how can i build expression even. Say for an example i have a parent transaction 0001 with 2 child transactions t1: 0001-1 and t2: 0001-2. In this case i need to consider amount of t1 and t2 and not the parent .
If you are developing this report through SSRS in visual studio, you can set the condition within the report instead of doing it through fetchxml. Have the fetchxml pull everything you need, and set your condition through expression in your report.
You can also set condition in tablix or charts by going through properties and play around with visibility and filters setting.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156