Find your content:

Search form

You are here

Case Assignment Rules - Assign to Queue and Email Members - no email sent (Insert by Apex)



When a case matches criteria is created assign the Case Owner to "Research Queue" and e-mail queue members.

Current setup:

  1. Queue created for Cases, no distribution email listed (Just Members)
  2. Create Assignment rule to assign Cases to queue based on criteria. Included E-mail Template for Notification


  1. Case assignment is successful. Case Owners are changed to the desired queue
  2. No e-mail notification is sent to the members

I'm stumped why the e-mails won't go out. It should e-mail each user individually, yet it doesn't.


The case is inserted via Apex. The Assignment Rule is being queried and set in the DML Options before the insert occurs. The Rule is being fired, the Assignment Rule assigns the owner, but does not do the E-mail notification.

If I manually create the case - bypassing the Apex setup -- the Assignment rule also fires AND sends the notification.

AssignmentRule AR = new AssignmentRule(); 
//Assignment Rule Query
AR = [select id from AssignmentRule where SobjectType = 'Case' and Active = true limit 1];
//Creating DML Options
Database.DMLOptions dmlOpts = new Database.DMLOptions();
if(AR != null){
   dmlOpts.assignmentRuleHeader.assignmentRuleID = AR.ID;
   insert mycase;  

So the Code assigns the Assignment rule (Which returns a valid rule), adds it to my DMlOptions and then sets the options. What else has to happen here?

Attribution to: Salesforce Wizard

Possible Suggestion/Solution #1

Check the properties of the case page layout.

Email notification checkbox [x] Select by default

Attribution to: liqmetal

Possible Suggestion/Solution #2

So the issues turns out to be the DML options.

In order for e-mails to get sent - even from Assignment Rules, the DML option has to be updated:

dmlOpts.EmailHeader.TriggerUserEmail = true;

Otherwise it will ignore any email trying to be sent internally that is not called by apex directly.

Attribution to: Salesforce Wizard
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content