global.beforeSetDisposition
Triggered before allocating the selected disposition. Helps prevent terminating the script on special cases or saving the comment history into a field.
Parameters
Name | Type | Description |
---|---|---|
comment | {String} | the comment written by the agent |
disposition | {Object} | the selected disposition |
Returns
Type | Comment |
---|---|
{Boolean} | If true, disposition is allowed, if false, disposition isn’t allowed |
{Object} | Disposition object |
Disposition object
Key | Type | Description |
---|---|---|
dispositionId | {Int} | The desired disposition that overwrites the one which was selected by the agent. |
next_calldate | {String} | Optional. You can specify the callback time. It has only effect if the selected disposition is a callback. Format: ISO 8601, YYYY-MM-DDTHH:MM:SS |
Example
If there are no ordered items, do not allow ordered dispositions.
$().beforeSetDisposition = function(disposition, comment) {
if (!vcc.isSelected('ordered_items') && disposition.assesment === vcc.DISPOSITION_ORDERED) {
vcc.alert('There are no ordered items, you cannot select a successful disposition');
return false;
}
};
Allows updating the disposition (to any dispositionid) selected by an agent in the script.
$().beforeSetDisposition = function(disposition){
return({dispositionId: 1, next_calldate: '2015-03-09T13:45:42'});
}
Comments
Can’t find what you need? Use the comment section below to connect with others, get answers from our experts, or share your ideas with us.
There are no comments yet.