- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 10:33 AM
Hello,
I was wondering if any one knows a way to make approval comments field mandatory when an approval admin is approving something that they are not listed as the approver?
I am running Helsinki Patch 10 and see the UI Policy to make this field mandatory when an approval is rejected but don't see any conditions that allow me to create another UI policy that will only set mandatory when someone other then the original approver does the approval.
thank you for your help in advance!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 10:38 AM
Hello,
Write a before update business rule on sysapproval_approver table as below
conditon: current.state changes to "Approved"
script:
if(gs.getUserID() != current.approver && gs.hasRole('approval_admin'))
if(current.comments == '') {
gs.addInfoMessage('Comments needs to be filled');
current.setAbortAction(true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 10:38 AM
Hello,
Write a before update business rule on sysapproval_approver table as below
conditon: current.state changes to "Approved"
script:
if(gs.getUserID() != current.approver && gs.hasRole('approval_admin'))
if(current.comments == '') {
gs.addInfoMessage('Comments needs to be filled');
current.setAbortAction(true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 11:22 AM
Thank you Saprem that did the trick.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 10:41 AM
Hi Nolan,
You can write a business rule to do so. Add a condition in business rule, approver != javascript:gs.getUser.getID()
Then you can check in the business rule script to check, if comments is empty, set abort action on the current record displaying error message 'Comments are mandatory'
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2017 11:23 AM
Hello Sanjiv,
Thanks for commenting appreciate the help!