function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Christoffer OliveiraChristoffer Oliveira 

How to bring a user online in OmniChannel via Apex?

I have a class that sends a case to some user who is online on OmniChannel. To test this class I need to create a user and make him online in OmniChannel and then send the case and check if it arrived for this user.  How to perform this test if the SObject UserServicePresence does not allow writing in the isCurrentState field? 
VinayVinay (Salesforce Developers) 
Hi Christoffer,

Check below reference that can help you.

https://salesforce.stackexchange.com/questions/110351/how-to-setup-test-data-for-omni-channel-in-apex-test-classes

Please mark as Best Answer if above information was helpful.

Thanks,