I need to get all Opportunities that are linked to accounts that match my criteria for accounts (for simplicity sake, lets say I want all active accounts) AND all opportunities that are also linked to all of the accounts that have hierarchical relationship to the account the opportunity is directly linked to.
For example, if I have an Account A and it's a parent to 3 other accounts (B,C,D), I want to fetch all Opportunities where Account A is the Client and all of the opportunities where Accounts B,C,D are also Clients.
Anyone knows how to achieve this?
<fetch top="50" > <entity name="opportunity" > <filter> <condition attribute="statecode" operator="eq" value="0" /> </filter> <link-entity name="account" from="accountid" to="customerid" > <filter> <condition attribute="accountid" operator="eq-or-under" value="e3345fae-c92e-4f68-b07e-73929d36d5be" /> </filter> </link-entity> </entity></fetch>
If you've found this thread useful, dive deeper into User Group community content by role