Pop-up confirmation upon approval

VS_09
Tera Contributor

When the approver goes to approval table to approve the request.

Once the approver clicks on Approve UI action button, he should receive a confirmation box saying ' Do you want to approve the request or you still want to continue reviewing? '

If approver click on OK, then request should be approved else it should be untouched (same as before).

 

kaur_developer_0-1708806673616.png

 

If anyone can help. It would be highly appreciated!!

8 REPLIES 8

Can you copy the script here? Hard to see with the screenshot

VS_09
Tera Contributor

condition:

current.state=='requested' && (gs.hasRole('approval_admin') || isApprovalMine(current) || (gs.hasRole('change_admin') && RP.isRelatedList()&&parent.sys_class_name == 'change_request'))

 

function promptApprover(){
if(confirm("Do you want to approve the request?")){
gsftSubmit(null,g_form.getFormElement(),'approve_record');
}else{
return;
}
}
if (typeof window == 'undefined')
updateApprovalRecord();
 
function updateApprovalRecord(){
current.state='approved';
current.update();
 
}
 
Also, I have added the error message which I am getting on approving the change request.
2. UI action is impacting for all tables RITM, Incident as well

The script and condition look fine to me. Did you populate the 'Action name' field as well?

VS_09
Tera Contributor

@James Chun 

My action name is approve_record.

1. But why it is showing error on change record, when i tried approving the request.

2. Why it is impacting other tables as well such as RITM, incident?