Skip to content

Instantly share code, notes, and snippets.

@karanrajs
Created January 26, 2015 10:07
Show Gist options
  • Save karanrajs/e88d3fc5d2f41003ad3e to your computer and use it in GitHub Desktop.
Save karanrajs/e88d3fc5d2f41003ad3e to your computer and use it in GitHub Desktop.
Enforce assignment rule in apex
// to turn ON the Assignment Rules in Apex
Database.DMLOptions dmlOptn = new Database.DMLOptions();
dmlOptn.assignmentRuleHeader.useDefaultRule = true;
leadObj.setOptions(dmlOptn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment