Users should not be able to approve their own requests
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 01:20 AM
Hello Team,
Can anyone suggest how to achieve this requirement?
If the approver = created by user(Requested for) then they should not be able to approve the request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 01:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 01:27 AM
Hello @nameisnani ,
Please refer below community link for the reference -
If it helps you solve the query, please mark it as Accepted✔️ and Helpful👍.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 01:27 AM
Hi @nameisnani
// Business Rule Name: PreventSelfApproval
// Table: <Name_of_the_table_where_approval_is_done>
// When to Apply: Before record insert
(function executeRule(current, previous /*null when async*/) {
// Check if the requested for is the same as the approver
if (current.requested_for == current.approver) {
// Prevent the record from being inserted and display an error message
gs.addErrorMessage("You cannot approve your own request.");
return false; // Prevent the record from being inserted
}
})(current, previous)
Please accept my solution if it resolves your issue and thumps up
Thanks
Jitendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 01:27 AM
Same thing I have tried , Not worked , could you please correct one . with demo screenshot