Is it possible to write a single FetchXML query that gets a root entity and multiple children? All I've been able to do is 1:1.
相关问题
- Dynamics CRM 365 - Cannot access Xrm.Page.entity i
- crm 2011 creating a view of merged contacts
- CRMAF Filtering in CRM 2011
- How to create and delete data from entity relation
- Crm dynamics custom action after clicking Invoice
相关文章
- Using Xrm.WebApi method in Web Resource opened in
- Authenticating with on-premise (IFD) CRM using NTL
- How to list all CRM fields which are dirty in cons
- How to get 'ownerid' column from CRM datab
- Call javascript function from another javascript w
- How to Get a Dynamics 365CE Personal Development E
- CRM do not support direct update of Entity Referen
- Microsoft Dynamics 365 SDK Core Assemblies .NET Co
Unless I've misunderstood the question this is very possible.
So for example you want to find all the contacts related to a given account. This is represented in Crm by the Parent Customer Lookup on the contact to the account.
Which gives you a result set that looks like this:
James Wood is correct. Fetch XML is recursive so by using the link entity you can get the information you want.
For example, the following is valid:
If your question really is "Is it possible to write a single FetchXML query that gets a SINGLE root entity and multiple children" then the answer is unfortunately no. However if you are able to handle duplicates of root data (For example using the Grouping functionality of an SSRS report) then what you require is entirely possible
No, it is not possible.
I'm happy to report that it is possible. I have a solution that worked well for me.
The only caveat is that if you have multiple child accounts you will get multiple results for the parent. For example:
This means that you would then have to run the results through a sorting function, to get either all the children under parents in a multi dimensional array, or get all the accounts as unique entries in a flat array.
Also, this only goes down one level. If your hierarchy is multi-level, this code would need to be modified.