Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

raiseAgentWorkFlag for Lightning Experience

Raises a flag for this agent work item.

Arguments

Name Type Description
workId string The ID of the work item to raise the flag on.
message string Optional. The message associated with this flag.

Sample Code

Component code:

1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2    <lightning:omniToolkitAPI aura:id="omniToolkit" />
3    <lightning:button label="Raise Flag" onclick="{! c.raiseFlag }" /> 
4</aura:component>

Controller code:

1({
2raiseFlag: function(cmp, evt, hlp) {
3    var omniAPI = cmp.find("omniToolkit");
4    omniAPI.getAgentWorks().then(function(result) {           
5        var works = JSON.parse(result.works);
6        var work = works[0];
7        omniAPI.raiseAgentWorkFlag({workId: work.workId, message: "Raise Flag Message"}).then(function(res) {
8            if (res) {
9                console.log("Flag raised successfully");
10            } else {
11                console.log("Flag raise failed");
12            }
13        }).catch(function(error) {
14            console.log(error);
15        });
16    });        
17}
18})

Response

This method returns a promise that, upon success, resolves to true and is rejected on error.

When Omni-Channel Fallback Mode is enabled, the raise and lower flag feature isn't supported. If this method is used, it doesn’t perform any operations and always resolves to true.

Note