createCustomer
These functions enable the users to create customer records
Description
vcc.createCustomer(form)
Creates a new customer with the given data. The content should follow what is described here.
Parameters
form
(form) Values to be passed for the new record.
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.