Change Request form set a variable to Read-only

Bret Smith
Giga Guru

How can I set a variable on the Change request form to be read-only depending on logged in user's role

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

You ca do so 

  • By an ACL, Read ACL on change_request.field_name and add the role to the ACL
  • Use a client script, onload
    if(g_user.hasRole('<role name>')==true)
    {
    g_form.setMandatory('<field name>', false);
    g_form.setReadOnly('<field name>', true);
    }​
-Anurag

View solution in original post

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Bret Smith 

Use ACL

AGLearnNGrow_0-1709915455249.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Anurag Tripathi
Mega Patron
Mega Patron

You ca do so 

  • By an ACL, Read ACL on change_request.field_name and add the role to the ACL
  • Use a client script, onload
    if(g_user.hasRole('<role name>')==true)
    {
    g_form.setMandatory('<field name>', false);
    g_form.setReadOnly('<field name>', true);
    }​
-Anurag

AndersBGS
Tera Patron
Tera Patron

Hi @Bret Smith ,

 

create an ACL for specific roles only have read access.

 

if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/