I'm trying to Suppress the Case assignment rule when case get create by LiveHelpNow Chat App. Also though the same Trigger i'm trying to assign the case to the LiveHelpNow Agent Name to i've captured into a Case.Case_Owner__c custom field and matched against the Salesforce slandered User object. Unfortunately i'm unable to disable the case assignment rule and case keeps getting assigned to The Queue by the assignment rule. I need the Case assignment rule because we also have web to case that we like those cases to be assigned to a Queue, so turning off Case assignment rule is off the table. Any Help Please.

trigger LiveHelpReAssign on Case (before insert)
    Map<String, Id> ownerUser = new Map<String, Id>();
    for(Case record : Trigger.new)
        if(record.Case_owner__c != record.Owner.Name)
            ownerUser.put(record.Case_owner__c, null);
    for(User record:[select Name 
                     From User 
                     Where Name IN :ownerUser.keyset()]) 
        ownerUser.put(record.Name, record.Id);
    for(Case record : Trigger.new)
        Database.DMLOptions dmo = new Database.DMLOptions();
        dmo.AssignmentRuleHeader.useDefaultRule = false;
        record.OwnerId = ownerUser.get(record.Case_owner__c);

enter image description here

  • What are the criteria defined in the Case assignment rule? Commented Jul 17, 2016 at 2:09
  • Case.Type = Contact us
    – Templar
    Commented Jul 17, 2016 at 2:10
  • Can you put picture of assignment rules? Commented Jul 17, 2016 at 2:11
  • did add the screen shot of the assignment rule.
    – Templar
    Commented Jul 17, 2016 at 2:22
  • already answered just before seeing the screenshot Commented Jul 17, 2016 at 2:24

1 Answer 1


There are different ways we can create cases and those can be handled and properly assigned to the queue or himself based on assignment rules.

You can define Case Origin picklist values as follows:

  1. Email-to-Case, Origin = 'Email'
  2. Web-to-Case, Origin = 'Web'
  3. Live Agent, Origin = 'Chat'

Also, you can define different recordTypes based on criteria (including Origin).

In the Case assignment rule, you can verify Origin or recordtype or other criteria and assign the cases to different owner.

If no criteria is matching, then you can assign the Case to the same user/Admin/specific user/queue.

Updating answer for userDefaultRule

If specified as true for a case or lead, the system uses the default (active) assignment rule for the case or lead. If specified, do not specify an assignmentRuleId.


If there are no assignment rules in the organization, in API version 29.0 and earlier, creating a case or lead with useDefaultRule set to true results in the case or lead being assigned to the predefined default owner. In API version 30.0 and later, the case or lead is unassigned and doesn't get assigned to the default owner.


Do not stop assignment rule. Rather than using trigger, you can use process builder to update the case owner for Chat origin cases. Process builder runs after Case assignment rules, Hopefully it helps.

  • I'm already Capturing the User into Case.Case_Owner__c custom filed and my code is matching that against the Standard User object. I just need to disable the Case Assignment rule for cases being created by LiveHelpNow
    – Templar
    Commented Jul 17, 2016 at 2:39
  • You can define an case origin as 'Chat' for those cases created by LiveHelpNow . Do not need to disable assignment rule Commented Jul 17, 2016 at 2:42
  • I've changed the Case Assignment Rule to "Case Origin not equal Chat" yet the rule still runs.
    – Templar
    Commented Jul 17, 2016 at 2:54
  • Assignment rule will always run if that it is active, check the updated answer and handle your scenario. Commented Jul 17, 2016 at 3:05
  • that is why in my code i try to turn off the case assignment rule for case created by LiveHelpNow. Also i do need the case assignment rule on to assign the non-chat cases to a Queue.
    – Templar
    Commented Jul 17, 2016 at 3:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .