You need to sign in to do that
Don't have an account?
Carlos Cicero
How to work with <lightning:omniToolkitAPI aura:id="omniToolkit" /> ?
I am doing a POC with lightning:omniToolkitAPI
I created and aura component to set in the background of the lightning service console. When the user changed the status I am calling the method getAgentWorks of the API but it is not calling at all and the API object is getting empty {} when printed the log console.log( JSON.stringify(omniAPI));
component
controller
I created and aura component to set in the background of the lightning service console. When the user changed the status I am calling the method getAgentWorks of the API but it is not calling at all and the API object is getting empty {} when printed the log console.log( JSON.stringify(omniAPI));
component
<aura:component implements="lightning:backgroundUtilityItem" access="global" > <lightning:omniToolkitAPI aura:id="omniToolkit" /> <lightning:utilityBarAPI aura:id="utilitybar" /> <aura:handler event="lightning:omniChannelStatusChanged" action="{! c.onStatusChanged }"/> </aura:component>
controller
({ onStatusChanged: function(cmp, evt, hlp) { console.log("Status changed."); hlp.getAgentWork(cmp, evt,hlp); } })Helper
({ getAgentWork: function(cmp, evt,hlp) { var omniAPI = cmp.find("omniToolkit"); console.log( JSON.stringify(omniAPI)); omniAPI.getAgentWorks({ callback: function(result) { console.log("inside callback getAgentWork "); if (result.success) { console.log('Get work items successful'); } else { console.log('Get work items failed'); } } }); console.log("getAgentWork call"); } })
Check below examples for <lightning:omniToolkitAPI aura:id="omniToolkit>
https://www.infallibletechie.com/2022/04/how-to-set-omni-channel-status-from.html
https://www.coursehero.com/file/p7uft73q/var-omniAPI-cmpfindomniToolkit-omniAPIgetAgentWorksthenfunctionresult-var-works/
https://salesforce.stackexchange.com/questions/249832/how-to-get-omnitoolkitapi-javascript-object
Thanks,