Salesforce Fact #65 | trigger.new in SOQL

We can use trigger.new and trigger.old in SOQL bind variable to find records based on the matching Id. Although trigger.new and trigger.old are list of SObject records, when we are matching them with recordId field it will consider the corresponding Id field with the same column name.

In this example, we are fetching the related contacts of all the account records present in trigger.new.

Collected from: One of the courses by David Liu in Pluralsight

Attached is the screenshot. 



Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow