function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Laurence EvansLaurence Evans 

Query criteria across 2/3 objects

Hello all,

I'm trying to query all tasks related to a claim, where there is a certain account name on that claim. I'm new - but I understand this as a 2 layer deep query, My question is, how do I do this?

I want the query to return all tasks related to a case where the account = x. Then I want to loop through those tasks and update the status to completed in a trigger. Can anyone point me in the right direction? I can write a query for DML from one object to another, but never referencing a 3rd object like this.

Thankyou
Laurence EvansLaurence Evans
I'm looking for relationship queries and have found the documentation, thanks people

https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_query_using.htm#sforce_api_calls_soql_relationships_query_using