The views and opinions expressed in this blog are those solely of the author(s) and do not necessarily reflect Microsoft’s current policy, position, or branding. For official announcements and guidance on Dynamics 365 apps and services, please visit the Microsoft Dynamics 365 Blog.
‘Better Together’ Integration forum available
We're launching a how-to forum where you can learn and engage about how Dynamics 365 integrates with other Power Platform products.
Read about Better Together forum
2020 release wave 1Discover the latest updates and new features to Dynamics 365 planned through September 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 TimelineWatch the 2020 Release Wave 1 virtual launch event
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 TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
Relationships in Microsoft Dynamics 365 Customer Engagement (CRM) and PowerApps Model Driven Apps can be decorated with a number of characteristics that define their behavior. These characteristics instruct the platform how to behave in regard to child data when different actions are taken on the parent record of the relationship.
The configuration of relationships describe what the system shall do when a record is Assigned, Reparented, Shared, Unshared and Deleted. For these actions it is possible to specify if the action shall be cascaded to child records based on their state, owner type, etc. Delete actions can specify that child records shall be deleted, orphaned, or that delete shall not be possible when a parent has children.
There is no simple way in the platform to see what effect the different actions will have, or even what effect they actually had after the action was performed. The only way is to look at the metadata of the relationships, a feature that normal users cannot access.
You may get stuck where you are prevented from deleting a record if there are relationships with Delete behavior: Restrict. This behavior means that it will not be possible to delete the parent record if there are any child records present in the system. The message from the platform will only tell you that it cannot be deleted, without any information of what is really preventing the delete.
Too late, you could realize that reassigning an event in your event management system does not reassign participant reservations and associated tasks, because the relationship was set to Assign: Cascade None.
After sharing an account with a team mate you may discover that it also made all otherwise classified cases available to the colleague, when the relationship had behavior Share: Cascade Active.
The XrmToolBox tool Related Records Analyzer can give insights to the challenges above and many more, before having to resort to crossing fingers and hoping for the best before executing actions on parent records.
There are two ways to select record to analyze. If you have the URL of a record, simply paste it into the Url / Search field, and RRA will parse the Url to find the referenced entity and record.
The other way is to first select entity type in the dropdown box. This will show the Quick Find view from CRM below, and then just type the search string into the Url / Search field. When you find the record to analyze, select it in the list.
The “Quick Find” in RRA will also allow you to enter a record id (guid) in the search field.
First select which types of relationships to include.
Invisible means relationships defined as not visible on the parent form. Note that this may be overridden in the design of each form in the system.
Select Only with data to exclude relationships in the report where there are no child records resent. Note that all relationships will be investigated, and it is only in the display these will be excluded.
Then check which types of behaviors to analyze. The selection is “excluding”, so behaviors not checked will not be included in the analysis. Example: If you wonder what will happen during Assign/Reparent, check the behaviors you want to investigate in that box, and keep all behaviors checked for Share/Unshare and Delete.
Now hit the Analyze Relations button!
The analysis process investigates all 1:M relationships on the selected entity, and filters them according to the Analysis Options. For each relationship to investigate, all child records are retrieved from CRM, including the columns from the child entity’s Quick Find view.
When the analysis is finished, you may see something like this:
A hierarchy view of the parent record, its relationships, and their child records is shown in the first tab. For child records, the value of the Primary Name Attribute is displayed, but if that attribute does not have a value the guid of the records is shown. In the example above, Reservations and Invoice Data have values assigned to their primary attributes, but Addresses do not.
Right-clicking a record in the hierarchy view gives you options to show details for the record, open it in CRM in the browser, or to select this child record as a new parent record in the parent record selector to the left.
When you select to View details, the tab will shift to the relationship for the right-clicked record, and the selected record will be highlighted.
In this view, you can see details about the relationship such as logical name and behaviors for different actions.
Expanding a record in the hierarchy view will load the next level of “grand children” from that child node, using the options specified above.
Children of child records can be expanded infinitely, as long as the child records have relationships matching the analysis options specified.
Download XrmToolBox – the Swiss Army Knife for anyone working with Microsoft Dynamics 365 / CRM – from www.xrmtoolbox.com.
Install Related Records Analyzer from the Plugins Store in XrmToolBox.
Contribute to the open source code for Related Records Analyzer at github.com/rappen/RelatedRecordsAnalyzer
If you want more features, submit issues to the GitHub repository:
If you need to ask a question or simply give the tool a shout-out, tag me on Twitter at @rappen.
The idea for this tool came from my old colleague and friend Sara that you may reach and follow on Twitter at @saralagerkvist
Displaying detail views is done using NuGet package CRMWinForm, a package containing CRM related utilities and a DataGridView control customized to be able to show CRM data using an EntityCollection as data source. This package is, well, also created by me.
The post Relationship data analysis with XrmToolBox appeared first on Dynamics 365 Trenches.
Business Applications communities