You need to sign in to do that
Don't have an account?
Tolga Sunar
Test Class for Apex Trigger defined on User Service Presence object
I have created an apex trigger that is defined on User Service Presence object, but I have no idea how to get even one line of it covered for deployment. This trigger simply detects when an user logins or logouts to a specific omni-channel presence, and updates a field on User object. Since User Service Presence object does not support DML calls and -as far as I know- it is not possible to simulate omni-channel presence login / logout event in a testmethod, I cannot cover any line of this trigger.
Any information about a workaround or a trick is greatly appreciated.
Any information about a workaround or a trick is greatly appreciated.
https://developer.salesforce.com/trailhead/en/apex_testing/apex_testing_triggers
Were you ever able to to get the code working and appropriate test class created? I have a similiar need. My original intent was to create a workflow on the User Presence object, however, it appears that it is unavailable. I am now attempting to write a trigger to accomplish the same actions. I would appreciate any knowledge \ code that you are willing to share. Thanks.