How assign assignment rule to Case using apex?

Sample Code:

Case cas = new Case();

Database.DMLOptions dmo = new Database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule = true;
cas.setOptions(dmo);

insert cas;

this is applicable even when you update the case.

No comments:

Post a Comment