Call Method from trigger to apex - Domreysa

Post Top Ad

Post Top Ad

Monday, June 11, 2018

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);

No comments:

Post a Comment

Post Top Ad

Responsive Ads Here