Case Assignment Using Apex Code
Requirement: When Case will insert using apex code assignment check box should be true.
Solution:
List<Case> lstofCase = new List<Case>();
Case objCase = new Case();
ObjCase.status="New";
lstofCase.add(ObjCase);
Insert lstofCase;
Database.DMLOptions dmo = new Database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule = true;
system.debug(' dmo.assignmentRuleHeader.useDefaultRule***'+ dmo.assignmentRuleHeader.useDefaultRule);
Database.update(lstofCase, dmo);
Thanks,
Sumit Shukla
mob: 9711055997
skypeID: shuklasumit1
email ID: sumitshukla.mca@gmail.com
Solution:
List<Case> lstofCase = new List<Case>();
Case objCase = new Case();
ObjCase.status="New";
lstofCase.add(ObjCase);
Insert lstofCase;
Database.DMLOptions dmo = new Database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule = true;
system.debug(' dmo.assignmentRuleHeader.useDefaultRule***'+ dmo.assignmentRuleHeader.useDefaultRule);
Database.update(lstofCase, dmo);
Thanks,
Sumit Shukla
mob: 9711055997
skypeID: shuklasumit1
email ID: sumitshukla.mca@gmail.com
Comments
Post a Comment