- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 07:36 PM
HI Need help
I am able to configure UI policy where in if someone is rejecting a change by going into approvals then it will ask for reason or comments for rejection (attachment 1)
However i noticed that when a approval right clicks and reject a change (attachment 2) it does not ask fro reason but straightway rejects the change
how to ensure every time change is rejected it asks for a reason , weather its rejected by right click
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 08:08 PM
Hi @karan15 ,
You can try creating a business rule like the one below, so that It will if the comments are filled in or not for rejection, and prevents rejecting the approval from Right Click even.
And, use the code below in Advanced Tab, business rule script.
(function executeRule(current, previous /*null when async*/) {
if(gs.nil(current.comments)){
gs.addErrorMessage('Please fill comments with reject reason. Please open the approval record and fill in the comments to reject.');
current.setAbortAction(true);
}
})(current, previous);
Thanks,
Anvesh
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2023 12:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 08:08 PM
Hi @karan15 ,
You can try creating a business rule like the one below, so that It will if the comments are filled in or not for rejection, and prevents rejecting the approval from Right Click even.
And, use the code below in Advanced Tab, business rule script.
(function executeRule(current, previous /*null when async*/) {
if(gs.nil(current.comments)){
gs.addErrorMessage('Please fill comments with reject reason. Please open the approval record and fill in the comments to reject.');
current.setAbortAction(true);
}
})(current, previous);
Thanks,
Anvesh
Anvesh