Saturday, June 15, 2019

De-escalate via script

Please refer to the user event script below which de escalates the case by removing the Escalatee :

function esc(){

var rec1 = nlapiLoadRecord('supportcase','23'); // Internal id of the support case
rec1.removeLineItem('escalateto', '1'); // remove the Escalatee
nlapiSubmitRecord(rec1); 

}

This can also be achieved via Client script, please refer to the cod below :


function esc() {
var count = nlapiGetLineItemCount('escalateto');

alert(count);

for(i=1;i<=count;i++)
{
nlapiSelectLineItem('escalateto',i);
nlapiRemoveLineItem('escalateto',i);
//nlapiCommitLineItem('escalateto');
}
// nlapiSetFieldValue('status',1);  // set the status to in progress or any other except of Escalated if deploying the function on Save Record function, or else the script can be deployed on Field Change function that would remove escalate once the Status is changed to other than Escalated

}

No comments:

Post a Comment