How to make Additional Comments read only when state is Awaiting Acceptance for HR Case in Portal

Surya_Prakash
Tera Contributor

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.

Surya_Prakash_0-1684333856351.png

 

TIA,

Surya. P

2 REPLIES 2

Isaias H
Tera Guru

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!

Amit Gujarathi
Giga Sage
Giga Sage

HI @Surya_Prakash ,
I trust you are doing great.

  1. In the business rule configuration, set the "When to run" field to "Before" and the "Update" checkbox to "true."

  2. 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