Apex Code:
// Instantiate a new Case Case newCase = new Case(); // Put here the code to initialize the fields with the information... // Instantiate the database options Database.DMLOptions dlo = new Database.DMLOptions(); // This line assigns the ID for the assignment rule you want to use // dlo.assignmentRuleHeader.assignmentRuleId = getAssignmentRuleId(); // This line assigns the active assignment rule dlo.assignmentRuleHeader. useDefaultRule = true; // This line sends email to the related contact. dlo.EmailHeader.triggerAutoResponseEmail = true; // This line sends email to the new case owner dlo.EmailHeader.triggerUserEmail = true; // Set the options just defined newCase.setOptions(dlo); // Create case. insert newCase;
No comments:
Post a Comment