How to make Additional Comments read only when state is Awaiting Acceptance for HR Case in Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2023 07:31 AM
Hi All,
I need to make the Additional Comments field read-only in portal, when the HR Case state is in "Awaiting Acceptance". Can you please help to make the configurations.
TIA,
Surya. P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2023 08:29 AM
Hi Surya:
On the standard "ticket" page, the widget "ticket-conversation" does not possess the Form widget, making it impossible to utilize Client Scripts or UI Policies. These widgets are designed to display information without the assistance of conditional scripts.
A workaround could be creating a write ACL applied to the "Additional Comments" field, and setting the condition builder to "State [is not] Awaiting Acceptance"
Note: if you only use that condition, the ACL will apply to all users and all views (UI16, Next Exp, Portal, Workspace)
I hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2023 08:43 AM
HI @Surya_Prakash ,
I trust you are doing great.
In the business rule configuration, set the "When to run" field to "Before" and the "Update" checkbox to "true."
In the "Advanced" field, add the following code:
(function executeRule(current, previous) {
if (current.state == 'Awaiting Acceptance') {
current.comments.setReadonly(true);
}
})(current, previous);
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi