Make variables editable for a particular group once the RITM is submitted

Aravind Prasann
Tera Contributor

Hi, I need a help to make variables editable only for a particular assignment group in servicenow once the RITM is submitted. Could someone please help with this ? 

I tried the below display BR on sc_req_item table with the condition "Item is catalog item name" and following code :

g_scratchpad.check_group = gs.getUser().isMemberOf('PC-Monitoring-AppMigration');

Then having an onload catalog client script as follows:

if (g_scratchpad.check_group == true) {

g_form.setVariablesReadOnly(false);

}

 

This doesn't seem to be working. please guide !. Thanks

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

update as this

function onLoad(){
	
	if (g_scratchpad.check_group.toString() == 'false') {
		g_form.setVariablesReadOnly(true);
	}
}

Remember there might be some other Catalog Client scripts or Catalog UI policies which are Applied on RITM

Ensure those don't run or else some variables might become readonly

Regards
Ankur

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

View solution in original post

7 REPLIES 7

update as this

getApplicationInstanceNames: function() {

var names = [];
var appRecord = new GlideRecord('cmdb_ci_appl');
appRecord.addQuery('u_epr_id', this.getParameter('sysparm_config'));
appRecord.addQuery('category', 'Application Instance').addOrCondition('category', 'Database Instance').addOrCondition('category', 'Resource');
appRecord.query();

while (appRecord.next()) {
names.push(appRecord.sys_id.toString());
}
return names.toString();
},

Regards
Ankur

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

Thank you very much ! 

Hi Ankur, 

Would it be alright if I ask your help in resolving the issue that I am facing with respect to the question I posted please ? 

 

https://community.servicenow.com/community?id=community_question&sys_id=1b2b0547db924910f77799ead39619e0

 

Based on the response above from you on the script include, i have modified and it is working fine for service portal, but on the native ui page side, on the slush bucket the options are not moving from left side to right side of the bucket ? Could you please help ?