Call Method from trigger to apex

3. Call Method from trigger to apex and with list<Account> and Map<Id,Account>

In Apex class:
  public class UpdateAccTriggerHandler {

public void updateAccountTest(List<Account> newAccList, Map<Id,Account> oldMap){
for(Account acc:newAccList){
//your code...
}
}
}

In Trigger :
  UpdateAccTriggerHandler updateAcc = new UpdateAccTriggerHandler ();
updateAcc .updateAccountTest(Trigger.New, Trigger.oldMap);

Comments

Popular posts from this blog

Privacy Policy

Query in Loop problem: ( we do not need to to select query in loop )

How to set up vscode with salesforce sandbox