You are here:
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.
-
Enable Omni-Channel.
- From Setup, in the Quick Find box, enter Omni-Channel, and select Omni-Channel Settings.
- Select Enable Omni-Channel.
-
Create an Apex trigger.
-
From the quick access menu (), select Developer Console.

- Select File > New > Apex Trigger.
- In the New Apex Trigger window, name the trigger AgentWorkTrigger, and select Agent Work as the sObject.
- Click Submit.
-
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'); } } } } - Select File > Save.
- From Setup, in the Quick Find box, enter Apex Triggers, and confirm that the AgentWorkTrigger status is active.
-
From the quick access menu (
-
Create an Apex trigger test.
- Select File > New > Apex Class.
- In the New Apex Class window, name the class AgentWorkTriggerTest, and click Submit.
-
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 } } } - Select File > Save.
- Deploy the Apex trigger and its test class from your sandbox to your production org as described in this Knowledge Article.

