+ Start a Discussion

Active Assignment Rule, Auto-Response Rule

I'm writing a trigger (with DML Operations provided in http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_database_dmloptions.htm) to check the 'Assign using active assignment rules' and 'Send notification email to contact' based on some conditions to work on Active Assignment Rule and Auto-Response Rule


Here is the Trigger based on the link provided above:


trigger AssignmentRule on Case (After Update, After Insert) {
for (Case c : System.Trigger.New) {
Database.DMLOptions dmo = new Database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule= true;


Please someone help me regarding this.


You use those options in a VF page or to affect other records. AFAIK, you can't use DML options on records already being processed.