Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

OData query to get some parent and grandparent fields

$
0
0

I'm new to OData and want to know if something is possible with a single REST query.

Imagine we have an Account (in AccountSet) and in there some Contacts (in ContactSet) and within these contacts we have some custom SubAccount (in a custom SubAccountSet).

So for a given SubAccount there's a parent Contact and for that there's a parent Account.

So far so good.

Now I want to get the following:

1. All SubAccount records satisfying some simple "eq" condition (e.e. some_field == null or something)

2. Return just some of the fields - not everything in the SubAccount object.

3. Also some fields from the parent Contact record. (there's a key field in the SubAccount)

4. Also some fields from the Contact's parent Account record. (there's a key field in the Contact).

Is this doable or must I develop several distinct queries and run them in succession (get all SubAccounts, then for each run another query to get parent and so on).

Could $expand be of use here?

Any help much appreciated!

Korp.


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>