Check out the latest features available in Dynamics 365 for Customer Engagement, including LinkedIn Connect, Voice of the Customer and Universal Resource Scheduling.
Dynamics 365 2019 release wave 2 plan Discover the latest updates to Dynamics 365.Release Plan | Weekly Deployment Notes
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants.Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements.
ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Talent TechTalks
Recently my friend called up for a requirement where they needed to show all contacts in customer hierarchy. Let me explain the scenario here before moving further
Suppose Account A is parent customer for Account B and Account B is the parent customer for Account C.
So the requirement is when Account A form is loaded, a sub-grid should on the form should show all the contacts of Account A + Account B + Account C. If Account B is loaded then the sub-grid should show all the contacts of Account B + Account C.
Let us approach the solution here. Ideally it is a two step solution.
Step 1 – Prepare the fetchxml which would allow us to fetch all the contacts in the entire customer hierarchy.
Step 2 – Bind the fetchxml to the sub-grid at run time to show the contacts.
Now for the first part, CRM 2015 introduces the new ‘under’ operator which eases out our task like anything. After some discussion, my friend came up with a perfect fetchxml to achieve this. For e.g the following is the fetchxml to show all the contacts in the hierarchy of ‘Account A’.
Wonderful isn’t it. It just gives you the results you want for this. With 2013 and prior versions you can imagine how much you would need to code to achieve the same.
So we have the fetchxml. Now coming to step 2 which is to bind the fetchxml dynamically to the grid.
As much as we learn new concepts, I think the best thing is to see them in action in real life and my genius friend hit the bulls eye on this. He is a very well know face in Dynamics CRM – Nishant Rana.
This above logic would work not only for customer – contact relationship but in other areas of hierarchy as well like finding all users in a reporting hierarchy.
Hope this helps!
Business Applications communities