- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 08-28-2021 10:22 PM
Part 1 | Part 2 | Part 3 | Part 4 |
Part5
|
Force commenting on rejecting of an approval
In my article Improving the Approval Experience, Part 2 I have introduced the custom variants of the "Approve" and "Reject" buttons, and now I want to demonstrate how the "Reject" buttons can be extended by a feature that forces the approver to enter a comment in a popup dialog:
Why do we need this?
OOTB you cannot reject an approval request without providing a reason. But the user experience is bad since the check for a missing comment is done server-side after submitting the form. The better approach would be to trigger a client-side check and open a respective popup dialog for entering a comment.
UI Page "approval_reject_confirm"
There are different approaches for building popup dialogs. One of them loads a prepared UI Page which acts as container for the form. Therefore, we have e to create a respective UI Page at first.
Go to System UI > UI Pages and create a new record with the following properties
Field | Value |
Name | approval_reject_confirm |
HTML |
|
Client script |
|
UI Action "Reject"
If already done, we can take the copied version of the OOTB UI Action "Reject" which was built in the article Improving the Approval Experience, Part 2. If not you can decide to extend the OOTB UI Action or create a new custom version (in that case don't forget to deactivate the OOTB variant!)
Go to System UI > UI Actions and modify the existing UI Action or create a new one with the following properties:
Field | Value |
Action name | reject |
Show update | (checked) |
Client | (checked) |
Form button | (checked) |
Form Style | Destructive |
Onclick | loadConfirmDialog(); |
Condition | current.state == 'requested' && (new ApprovalDelegationUtil().isMyApproval(current)) |
Script |
|
Feel free to customize the code according to your needs. And please let me know in the comments if you have any suggestions for improvement.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Is there a way to achieve the same when performing the rejection (using the List Choice and List Context Menu Reject UI Action)?
I tried with creating the UI Page as shared by you and updating the two OOTB the UI Actions as attached. But it doesn't seem to work. Can you please help me on the same, if it is possible.
Thanks in advance.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
What a great series! Thank you @Maik Skoddow