in callBack function of runApex(), it reruns JSON...I want to get value from the callback function so that I could perform my logic but I am unable to do so because not having the exact value but a JSON string.
sforce.opencti.runApex({
apexClass : 'myController',
methodName : 'getStatus',
methodParams : 'providerClass=' + providerClass,
callback : function(result) {
if (result.success) {
var retVal = result.returnValue;
console.log('This is return value >>' , result.returnValue);
if( result.returnValue.status == " ringing")
{
console.log('This is taking the retun value as ringing');
//set the label to Dialing and dont start the time!
}
} else {
throw new Error('Unable to make a call. Contact your admin.');
}
}
});
JSON.parse
? Is this code Javascript?console.log('This is return value >>' , result.returnValue);
What does the payload look like currently?