Fix Script against Scoped Applications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2020 12:45 AM
Hi,
I have created Global Fix Script to create records in one of my scoped applications. But, I got below error.
"Security restricted: Create operation against 'x_486589_demo_scoped_application' from scope 'rhino.global' has been refused due to the table's cross-scope access policy"
Note: I have used 'update()' method to create records.
Later, I have created fix script in my scoped application then it worked.
Can anyone explain what cross-scope access policy, which is mentioned in above error?
Thanks in Advance!
Thanks,
Hema
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2020 01:28 AM
Hi Ankur,
Please refer to the snapshot and the script.
Script:
var today = new GlideDateTime().getDate();
var gr = new GlideRecord('x_demo_custom_table_1');
gr.query();
while(gr.next())
{
var kd = gr.u_glide_date_1.getDisplayValue();
var id = gr.getValue('sys_id');
if(kd == today)
{
var gr1 = new GlideRecord('x_demo_custom_table_2');
gr1.initialize();
gr1.insert();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2020 01:49 AM
Hi Hema,
I assume you have set Can Create, Can Update on this table "x_demo_custom_table_2"
If yes then it should work.
Try clearing instance cache using cache.do and then logout and login again
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
07-13-2020 03:38 AM
Hi Ankur,
Thank you for your quick replies.
I have tried after clearing the instance cache as well but, still no luck. I am not sure where I am exactly doing wrong.
Could you please give a shot from your end if possible.
Thanks,
Hema
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2020 03:52 AM
Hi Hema,
Did you try adding logs?
var today = new GlideDateTime().getDate();
var gr = new GlideRecord('x_demo_custom_table_1');
gr.query();
while(gr.next())
{
var kd = gr.u_glide_date_1.getDisplayValue();
var id = gr.getValue('sys_id');
if(kd == today)
{
gs.info('Inside creation');
var gr1 = new GlideRecord('x_demo_custom_table_2');
gr1.initialize();
gr1.insert();
}
}
If this is for your PDI then share url, also create some admin user and share credentials (username, password) then it can be checked
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
07-13-2020 01:06 AM
Hi Hema,
Please share the steps to reproduce this issue. I have also covered on this topic in my blog here. You may find helpful. Securing an application using Cross Scope Access, Application Access Settings & Restrict Table Choic...
- Pradeep Sharma