• DanWareing1
  • 0 Points
  • Member since 2015
  • Salesforce.com Manager
  • Secret Escapes

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 2
I am trying to use a PendingServiceRouting After Insert Trigger to manually create an AgentWork object to assign cases through Omni-Channel but it appears the trigger is not firing. I am able to create cases via Email-to-Case and query the PendingServiceRouting object, so I know it is being created. I am also able to call my code from Anonymous Apex, passing in the PendingServiceRouting object I created and it executes as expected.

Can anyone confirm that After Insert triggers can be used with PendingServiceRouting objects and/or offer some advice on how to proceed?
trigger OnPendingServiceRoutingTrigger on PendingServiceRouting (after insert) {

    if (trigger.isAfter && trigger.isInsert) {
        System.debug('After Insert PendingServiceRouting Trigger');
public class PendingServiceRoutingTriggerHandler {

    public static void afterInsert (Map<Id, PendingServiceRouting> NewPsr) {