lowerAgentWorkFlag for Lightning Experience
Lowers a flag for this agent work item.
Arguments
Name | Type | Description |
---|---|---|
workId | string | The ID of the work item to lower the flag on. |
Sample Code
Component code:
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
<lightning:omniToolkitAPI aura:id="omniToolkit" />
<lightning:button label="Lower Flag" onclick="{! c.lowerFlag }" />
</aura:component>
Controller code:
({
lowerFlag: function(cmp, evt, hlp) {
var omniAPI = cmp.find("omniToolkit");
omniAPI.getAgentWorks().then(function(result) {
var works = JSON.parse(result.works);
var work = works[0];
omniAPI.lowerAgentWorkFlag({workId: work.workId}).then(function(res) {
if (res) {
console.log("Flag lowered successfully");
} else {
console.log("Flag lower failed");
}
}).catch(function(error) {
console.log(error);
});
});
}
})
Response
This method returns a promise that, upon success, resolves to true and is rejected on error.