Fix Script against Scoped Applications

Hema2
Giga Contributor

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

14 REPLIES 14

Hi Ankur,

 

Please refer to the snapshot and the script.

find_real_file.png

 

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();
    }
}

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

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

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

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

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

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

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