Set Variables readonly on RITM

Sandeep kumar J
Tera Contributor

Hi Community

I need help for the below requirement

I want to make the variables read-only on the RITM form. I wrote a UI policy on the RITM table please find it below

find_real_file.png

This is working, but I have some variables for which the "Name" starts with "Edit_" should be editble on the RITM.

I have tried the below code, but it is not working

g_form.setReadOnly('variables.nameLIKEEdit^active=true','false');

Can you please help me if there is a way to fix this

 

Thanks in advance

22 REPLIES 22

Nasreenfathima
Giga Expert

Hi,

 try this,

To make the VEditor read-only in Now Platform, activate the onLoad client script, Variable Editor Readonly, for the following tables: Requested Item [sc_req_item].

Inactive_Us2002
Kilo Guru
Hi, Use the below code in the OnLoad Client script and give a try.. function onLoad() { if(item and assignment group condition) { g_form.setVariablesReadOnly(true); } }

Rekha Esadkar
Tera Expert

Hi @author ,

please refer below snapshot,

You dont need to write Code .You can achieve it using configuration. Make changes according to Your variable name.

find_real_file.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Sandeep kumar Jadhav 

As mentioned by members you can directly use catalog client script and no need of UI policy

Ensure this when you create catalog client script on your Catalog Item

UI Type - Desktop

Applies on Requested Item - True

Script:

function onLoad() {
	//Type appropriate comment here, and begin script below

	g_form.setVariablesReadOnly(true);

}

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader