Custom Triggers

Distribution Engine must update records to assign them. In order to avoid any conflicts, its recommend that any triggers you have do not fire when DE is making its update. To do this you can use the example below.

Lead update

In addition to changing the lead owner, Distribution Engine updates a few other fields on the lead object. These can be used to detect a DE update and avoid any conflicts. The code snippet below will tell you whether a lead update is currently being triggered by DE. This approach also works for Case, Account, Contact & Opportunity objects.

//Check if this update is caused by a Distribution Engine assignment / reassignment
boolean isDE = false;
Lead oldLead = Trigger.old.get(0);
Lead newLead =;
if((newLead.n2de__Is_distributed__c && newLead.n2de__Last_distributed__c != oldLead.n2de__Last_distributed__c) || 
   (newLead.n2de__Is_reassigned__c == true && newLead.n2de__Last_reassigned__c != oldLead.n2de__Last_reassigned__c)){
     isDE = true;
//If this was Distribution Engine making its assignment then don't run custom trigger

How did we do?

Invalid Email trigger