You need to sign in to do that
Don't have an account?
Rohit SharmaG
Enable Assign using active assignment rules via Backend
Hi Dears,
I want to enable Assign using active assignment rules via backend , not from pagelayout. please assist on this.
I want to enable Assign using active assignment rules via backend , not from pagelayout. please assist on this.
AssignmentRule rules = new AssignmentRule();
rules = [select id from AssignmentRule where SobjectType = 'Case' and Active = true limit 1];
//Creating the DMLOptions for "Assign using active assignment rules" checkbox
Database.DMLOptions Opts = new Database.DMLOptions();
Opts.assignmentRuleHeader.assignmentRuleId= rules.id;
Case newCase = new Case(Status = 'New') ;
//Setting the DMLOption on Case instance
newCase.setOptions(Opts);
insert newCase