- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2022 12:03 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2022 12:10 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2022 02:26 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2022 02:31 AM
Thank you very much !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2022 12:03 AM
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 ?