1

Trying to query the main parent in the hierarchy.

I have a case whose related account is a child of another account in hierarchy. Can someone please suggest how to query for the main parent in the hierarchy ?

Current Query:

SELECT Id, accountId from case

Need to modify the above statement to something like

SELECT Id, accountId.parent from case

1 Answer 1

1

Rather than getting the parent of the AccountId, as you're trying to at the moment.

You need to instead traverse the Account relationship and get the details of the parent from there.

SELECT Id, Account.ParentId FROM Case

You can read more about Relationship Queries here.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .