setDispositionPrefUserId
Sets the user to whom the callback will be assigned.
Description
setDispositionPrefUserId(userId: number)
It defines the userId who will be assigned to the next call event, e.g., a callback
userId: number
The ID number of the user
Return values
None
Example
The example code below loads agent users to a Select controller via internal API from which the agent can select another agent, and it will be set as the preferred agent.
var selectedUserId = null;
$('def.userlist').afterSetData = function(user) {
selectedUserId = user.valueid;
}
$('def.recallbtn').afterSetData = function() {
if (selectedUserId) {
// beállítjuk a pref usert + recallra terminálunk.
vcc.setDispositionPrefUserId(selectedUserId);
vcc.setDisposition(1, {saveAndRecall: false});
} else {
alert('Please select user first!');
}
}
$('def.loadusers').afterSetData = function() {
// Retrieve the list of users via API
vcc.callCustomerApi('GET', 'https://account.asp.virtual-call-center.eu/v2/users', null, function(success, data) {
if (success) {
// We create a list for the Select controller
const users = data.response
.filter((user) => user.status === "active" && user.is_agent === true)
.map(user => ({
label: `${user.name} (${user.userid})`,
valueid: user.userid,
fieldid: 59,
export_value: String(user.userid),
description: "",
commission: 0,
price: 0,
name: user.name
}));
// We overwrite the Select controller and refresh it
vcc.overrideValues('userlist', users);
vcc.getController('def', 'userlist').rebuild();
} else {
alert('Something went wrong! [GetUserList]')
}
});
};
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.