Hi
I have to find all account records that are at lowest level in the hierarchy, means accounts with no child account records. Is there any way to do this by LINQ, FetchXML or Query Expression?
*This post is locked for comments
Hi
I have to find all account records that are at lowest level in the hierarchy, means accounts with no child account records. Is there any way to do this by LINQ, FetchXML or Query Expression?
*This post is locked for comments
Hi,
try this:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="account">
<attribute name="name" />
<attribute name="accountid" />
<filter type="and">
<condition entityname="childaccount" attribute="accountid" operator="null" />
</filter>
<link-entity name="account" alias="childaccount" from="parentaccountid" to="accountid" link-type='outer'>
</link-entity>
</entity>
</fetch>
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,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156