Error with this code, script include is working fine. but state is not updating

Singhdeep70
Tera Contributor
var obj = new VECReviewUtils();
var isComplete = obj.areAllReviewsCompleted(current.sys_id);

if (!isComplete) {
    gs.addErrorMessage('All review tasks must be completed before approval.');
    action.setRedirectURL(current);
    current.setAbortAction(true);
}

if (!current.review_comments) {
    gs.addErrorMessage('Review Comments are mandatory before approval.');
    action.setRedirectURL(current);
    current.setAbortAction(true);
}

current.approval_status = 'approved';
current.state = 'approved';
current.update();

action.setRedirectURL(current);
1 REPLY 1

ShwetaS
Tera Expert

could you please check current.state = 'approved' ?

 

here 'approved' is label name. we should put value.