Make change template fields read only

ThiagoPereiraRJ
Tera Contributor

Hi everyone!

I have a requirement to make some fields in the Change property read-only.
I've already managed to do most of the work by including them in the "Standard Change Properties".
However, there are two fields that I'm having trouble with, even though they're in the property: risk and impact.
Does anyone have any idea what the problem might be?

ThiagoPereiraRJ_0-1768577509080.png


thanks!

5 REPLIES 5

Dr Atul G- LNG
Tera Patron

Hi @ThiagoPereiraRJ 

It might be conflicting with another property that makes it mandatory, so mandatory and read-only cannot work together.

 

DrAtulGLNG_0-1768578408099.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/dratulgrover [ Connect for 1-1 Session]

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

Hi @Dr Atul G- LNG 


In the image you sent, the field marked as mandatory is [Risk and impact analysis].

In my case, they are two different fields: [risk] and [impact].

 

ThiagoPereiraRJ_0-1768583517162.png

 

M Iftikhar
Tera Sage

Hi @ThiagoPereiraRJ,

 

The "Read-only fields" property works by triggering an out-of-the-box (OOTB) Client Script called "Mark standard change fields readonly" If this isn't working, it is usually because:

The "Type" Field is Missing: The script relies on the type field (which must be set to "Standard") to trigger. If the type field is not present on your Change Request form layout, the script cannot identify the record as a Standard Change and fails to apply the read-only restriction.

 

MIftikhar_0-1768579138210.png
MIftikhar_1-1768579187708.png

 

If my response helped, please mark it as the accepted solution so others can benefit as well.

 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

Hi @M Iftikhar 
The type field exists:

ThiagoPereiraRJ_1-1768583718724.png

The script is working. I added some logs to it and it goes through the two fields but doesn't set them as mandatory. It works correctly for the other fields.