I am doing a project in Salesforce Softphone using Open CTI.
I am having issue updating Activity History after I save the log using OpenCTI saveLog() function.
Here is my code:
var saveParams = 'Subject=' + moment(new Date()).format('lll');
saveParams += '&WhoID='+ContactID;
saveParams += '&CallDisposition=' + selectedDispo;
saveParams += '&CallType=' + calledType;
saveParams += '&CreatedDate=' + new Date();
saveParams += '&CallObject=' + callNumber;
saveParams += '&Description=' + $j('[id$=inputTextLog]').val();
sforce.interaction.saveLog('Task', saveParams, saveLogCallback);
function saveLogCallback(response){
if (response.result){
//This updates Open Activity. I want to update Activity History
sforce.interaction.refreshRelatedList('Activity',checkRefreshResult);
}
else{
console.log('>>> SoftPhone.saveLogCallback: Could not save object!');
}
}
function checkRefreshResult(response){
if (response.result){
console.log('>>> SoftPhone.checkRefreshResult: The related list is refreshed!');
}
else{
console.log('>>> SoftPhone.checkRefreshResult: Cannot refresh the related list', response);
}
}