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.