How to add custom flags to each contact result - Brekeke CRM
From Brekeke CRM Version 2.7.5.1a9.12318 or later, you can add the multiple flags to each contact result.
CRM
Step 1. At Brekeke CRM, move to the [Project menu] > [Settings] > [Contact Result] menu.
Step 2. With the JSON format, add the flags to the each contact result at [Options] of the [Result] fields.
Example:
[ {"value":"Complete", "flags" : [ "success", "ok" ] }, {"value":"Incomplete", "flags" : [ "ng" ] }, {"value":"Incomplete2", "flags" : [ "ng" ] } ]
Step 3. At the same page, set the script that automatically saves flags tied to contact results into database.
In order to be kicked the script when when agents save a contact result during their operation, select a “onContactResultCommit” at the “Auto Exe” field.
Example:
var agentWidget = Brekeke.CTI.getClientApp().getAgentWidget({});
var call = crmAgent.getCallInfo();
var flags = $view.contact.fields["result"].getValueOption( "flags" );
console.info(flags) ; //for debug
if(call && call.callId != 'no_call'){
var ev = {};
ev.callId = call.callId;
ev.callInfo = {};
ev.callInfo.callTag1 ='|' + flags.join( '|' ) + '|';
console.info(ev) ; //for debug
agentWidget.operate(Brekeke.CTI.Constants.changeCallInfo,ev,"");
}
In this case, if an agent selects “Complete” as a contact result in the agentview, the string of the flags “|success|ok|” is saved into the callTag1 field.
If an agent selects “Incomplete” or “Incomplete2” as a contact result in the agentview, the string of the flag”|ng|” are saved into the callTag1 field.
* The following fields are reserved for storing customized information.
call.callInfo.callTag1 call.callInfo.callTag2 call.callInfo.contactResult2
Related Links:
How to show custom flags in real time reports – Brekeke CA