Monday, October 21, 2013

Apex Trigger - Only Run at Point of Entry

You can put in a very simple condition that will prevent a trigger from running when bulk updates are made. This will only let the trigger run when one record is being edited at a time. This will exclude List View updates and data loader insert/updates:

if (Trigger.new.size() == 1) {

if (Trigger.old[0].isConverted == false){

}

}

No comments:

Post a Comment