0

Can any one please make me understand what is happening in below class

public class AssignLeadsUsingAssignmentRules {    
 @InvocableMethod     
 public static void LeadAssign(List<Id> LeadIds)     {   
 Database.DMLOptions dmo = new Database.DMLOptions();    
 dmo.assignmentRuleHeader.useDefaultRule= true;  
 Lead Leads=[select id from lead where lead.id in :LeadIds];  
 Leads.setOptions(dmo);      
  update Leads;  
 }   
 }

This class involved in one of process builder flows

enter image description here

enter image description here

The same condition we can give at lead assignment rule, then why did they invoked the apex class in process builder?

1 Answer 1

0

Go to Setup --> Leads --> Lead Assignment Rules.

There should be an Active lead assignment rule defined there. Based on the rules mentioned in that assignment rule, your Lead's are being assigned to that particular user/queue.

More on this here

1
  • The same condition we can give at lead assignment rule, then why did they invoked the apex class in process builder?
    – user24737
    May 30, 2016 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy