Created
July 10, 2017 15:52
-
-
Save theWill/200d3d32e84e88c09c5215ec24779921 to your computer and use it in GitHub Desktop.
Brian's Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment