Loading
Feature Disruption - Service Cloud VoiceRead More
Feature degradation | Gmail Email delivery failureRead More
Put Employees First with Work.com
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Enable Omni-Channel Routing for Employee Concierge

          Enable Omni-Channel Routing for Employee Concierge

          Omni-Channel routing for the case object is automatically enabled when you install Employee Concierge version 8.5 for the first time. However, if you installed Employee Concierge prior to version 8.5 and choose to use Omni-Channel routing, you must manually enable it from Setup. In addition, you must create and deploy an Apex trigger and test class.

          Complete all steps in your sandbox. Then use an Outbound Change Set to deploy your Apex trigger and test class to production.

          1. Enable Omni-Channel.
            1. From Setup, in the Quick Find box, enter Omni-Channel, and select Omni-Channel Settings.
            2. Select Enable Omni-Channel.
          2. Create an Apex trigger.
            1. From the quick access menu (
              Gear icon
              ), select Developer Console.
            2. Select File > New > Apex Trigger.
            3. In the New Apex Trigger window, name the trigger AgentWorkTrigger, and select Agent Work as the sObject.
            4. Click Submit.
            5. In the AgentWorkTrigger field, enter the provided code.
              trigger AgentWorkTrigger on AgentWork(before insert, after insert, after update)
              {
                  if (Trigger.isAfter) {
                      wkdw.AgentWorkTriggerHandlerGlobalProxy.handleTrigger(
                          Trigger.newMap,
                          Trigger.oldMap,
                          Trigger.operationType
                      );
                  } else {
                      for (AgentWork aw : Trigger.new) {
                          if (aw.WorkItemId == null) {
                              System.debug('WorkItemId should not be null');
                          }
                      }
                  }
              }
              
            6. Select File > Save.
            7. From Setup, in the Quick Find box, enter Apex Triggers, and confirm that the AgentWorkTrigger status is active.
          3. Create an Apex trigger test.
            1. Select File > New > Apex Class.
            2. In the New Apex Class window, name the class AgentWorkTriggerTest, and click Submit.
            3. In the AgentWorkTriggerTest field, enter the provided code.
              @IsTest
              public class AgentWorkTriggerTest {
                  @IsTest
                  public static void AgentWorkTriggertest() {
                      try {
                          AgentWork newAgentWork = new AgentWork();
                          insert newAgentWork;
                      } catch (Exception ex) {
                          // FIELD_INTEGRITY_EXCEPTION, The agent's status is not associated with the channel for this work.: [ServiceChannelId] will be caught after the trigger invocation
                      }
                  }
              }
            4. Select File > Save.
          4. Deploy the Apex trigger and its test class from your sandbox to your production org as described in this Knowledge Article.
           
          Loading
          Salesforce Help | Article