+ Start a Discussion
Uvais KomathUvais Komath 

How to insert UserServicePresence record via Apex?

  1. Tried with Apex : gets "DML Not supported error"
  2. Tried with Workbench REST Explorer gets following error :
message: entity type cannot be inserted: User Presence

Any help is appreciated, Basically i am trying to build a lightning component for users to go offline from MOBILE
Tried both Javascript API and OmniChannelToolKit, Both does not work outside service console
Meghna Vijay 7Meghna Vijay 7
DML calls cannot be made by UserServicePresence. You can only use SOQL to get it's records but you can't change them.
SFDC Prime SquadSFDC Prime Squad
Hi Uvais,
Only below operations are supported for UserServicePresence object:
delete(), query(), getDeleted(), getUpdated(), retrieve(), undelete()

More details on: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userservicepresence.htm