- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2016 12:21 AM
Hi Frds,
I`m facing a issue in script include, created script inculde and set protection policy as read only on Fuji version. I have admin rights but not able to edit this? I want to edit or delete this script include. Pls help.
Thanks,
Ravish
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2016 01:13 AM
var gr = new GlideRecord("sys_metadata");
gr.get("42ec6aa0ef62210066fc36caa5c0fbce"); // sys_id of record
gs.print(gr.sys_policy);
gr.sys_policy="";
gs.print(gr.sys_policy);
gr.update();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2016 12:38 AM
Hi Ravish,
These links may help you for that:
Protection Policy for Script Include
Script Include Protection Policy
Script Includes - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2016 12:51 AM
Write background script to update Script include
1. update the protection value as none, so that you can update the script include
var rec = new GlideRecord('table name');
rec.addQuery('sys_id',sys_id);
rec.query();
if(rec.next()) {
rec.field_name = 'NULL';
rec.update();
}
2. delete the script include
Note : to turn on the back ground script.. you have to enable the Elevated privalizes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2016 01:08 AM
Hi Ajai,
Thank for the reply, I did R&D on servicenow community linkes help but not able to find any correct solution which i can did my self.
Hi Basha, Thank you for your response, could you pls tell me in detail how to write background script, is there no any other way if i want to delete this? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2016 01:13 AM
var gr = new GlideRecord("sys_metadata");
gr.get("42ec6aa0ef62210066fc36caa5c0fbce"); // sys_id of record
gs.print(gr.sys_policy);
gr.sys_policy="";
gs.print(gr.sys_policy);
gr.update();