Salesforce Certified Application Architect

Friday 18 December 2015

Trigger being called twice when i was hiiting my rest api call through trigger

Here's the class with the static share property:

public with sharing class MyClass {

     public static set<ID> updateMethod = new set<id>();

    }


Then added to the trigger:
trigger MyTrigger on Lead (before update, after update) { 
for(Lead Lee:trigger.old){

if(!MyClass.updateMethod .Contains(Lee.Id) && !Leads1.isempty() && Trigger.isAfter ){
MyClass.updateMethod .Add(Lee.Id);
ClsName.MethodName(Leads1);    // rest Api class and method
}

Else{
    MyClass.updateMethod .Remove(Lee.Id);
}

}

}


No comments:

Post a Comment

Salesforce Certified Application Architect & Certified Data Architecture and Management Designer Exam

How to pass Salesforce Certified Data Architecture and Management Designer Exam This exam was 1st architect exam for me. Its not that muc...