Delete a custom record created after "Insert and stay" of read only record

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 07:00 AM
Hi
I created a copy of an OOTB business rule - Create controls running on Risk Identification [sn_risk_advanced_risk_identification] table.
This BR was "Read only based on its protection policy", however i was able to create a copy of the same but now i am unable to update the new BR since the new BR also got created as "Read only based on its protection policy"
Can anyone help me with deleting this record?
I tried to do it from Fix script, background script but no luck. I also tried to change the xml of the record to set it Active as false and tried importing but everytime it is giving same error -
Background message, type:access, message: This item is read-only based on its protection policy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 07:02 AM
Hi
Check Write & Delete ACLs on sn_risk_advanced_risk_identification table which is stopping you to delete.
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 07:09 AM
I have admin and security_admin rights both. I can delete other records but this record is "Read only based on its protection policy"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 07:17 AM
Hi,
Please do write the fix script with below mentioned script and run the same, it should work 🙂
var gr = new GlideRecord('sys_script_include');
if (gr.get('add sys id of script include')) {
gr.sys_policy = ''; //remove protection
gr.update();
gr.deleteRecord(); --> add this line if you want to delete the record else you can set the value as empty
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 07:36 AM
No luck. I get this message -
Background message, type:access, message: The Protection policy field cannot be changed for application GRC: Advanced Risk
Tried in both Global and GRC: Advanced Risk scope