Making some fields read-only on RITM form

prudhvig
Tera Expert

Hi,

I am currently working on the Service Catalog application.

In that, I have created a Catalog Item named "General Request" which creates a Request when ordered. Along with a request, RITM will also be created with variables from catalog item. When RITM is created, the variables should be made read-only.

Below is the screenshot of catalog item:

Screenshot (539).png

Below is the screenshot of the RITM created which contains the variables from Catalog Item. Here, I want the "Requesting for Company" and "Client Requestor" fields to be made read-only.

Screenshot (541).png

How can I make them read-only. Please help.

1 ACCEPTED SOLUTION

Hey Prudhvi,



  g_form.setReadOnly('Variable name', true);



post me your feedback


Please Hit ✅Correct, ��Helpful, or ��Like depending on the impact of the response


Have a lovely day ahead




Regards,


Divya Mishra


View solution in original post

4 REPLIES 4

divya mishra
Tera Guru

Hey Prudhvi,



  g_form.setReadOnly('Variable name', false);



post me your feedback


Please Hit ✅Correct, ��Helpful, or ��Like depending on the impact of the response


Have a lovely day ahead




Regards,


Divya Mishra


Hey Prudhvi,



  g_form.setReadOnly('Variable name', true);



post me your feedback


Please Hit ✅Correct, ��Helpful, or ��Like depending on the impact of the response


Have a lovely day ahead




Regards,


Divya Mishra


Hi Divya,



Thanks for the reply. But, could you please tell me where to write those lines of code in Servicenow? I have three variables which need to be read-only. So, it comes up to 3 lines of code. Where do I write those lines?


Hi Prudhvi,


Create on load "Catalog Client Script" for your requirement


Please find attachment as a reference. To apply script on "RITM" select "Apply on requested Item" Check box.


Capture.PNG