I need to use the OmniToolkitAPI to change statuses in Salesforce. To do so, only Aura component can change omnichannel status (I think)

I am using Service Console in my Salesforce. I implemented this aura component in my cases or chats When the user close the tab i want to:

  • first check if there is somes opened tasks assigned to him
  • I need to set a new presence status depending from the response I get from the first step

Here is my code:

unrender: function(cmp, event, helper) {

    omniAPI.getAgentWorks().then(function(result) {
        if(JSON.parse(result.works).length >= 2){
            omniAPI.setServicePresenceStatus({statusId: "0N51j000000Ci9c"});
            omniAPI.setServicePresenceStatus({statusId: "0N51j000000CpE0"});

this code works when This code is running in unrender method but when it's in a controller all works fine

Can unrender have some limitations I don't know ? I think it not resolve the promises (but i still get responses from getAgentWorks())


You must log in to answer this question.

Browse other questions tagged .