assignCustomer
These functions enable the users to assign chat conversations to records.
Description
vcc.assignCustomer(recordid,contactid)
Assigns the chat conversation to a record’s contact that was searched earlier
Parameters
recordid
(integer) The record ID to which the chat will be assigned to.
contactid
(integerg) The contact ID to which the chat will be assigned to.
Return values
none
Example
function saveCustomerAndAssignChat(ctx){
var clientid = vcc.getVariable('clientid');
var records = vcc.searchCustomer("clientid", clientid);
if (records && records.rows.length > 0){
vcc.updateCustomer(records.rows[0].id, {"clientid": clientid})
vcc.assignCustomer(records.rows[0].id,0);
return;
}
var newCustomerId = vcc.createCustomer([{
"form": {
"clientid": clientid
};
}])
if (newCustomerId !=0){
vcc.assignCustomer(newCustomerId,0);
}
}
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.