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 Hema,

 

Since, you want to insert/create records can you make sure the Can Create flag is set to True as well. Also, give link a check.

find_real_file.png

Hi Jaspal,

 

I did the same as above and tried after clearing the instance cache as well. But, still no luck.

 

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

 

Please do let me know, if you find anything or give a shot from your end if possible.

 

 

Thanks,

Hema

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Hema,

If you have created fix script in Global Scope and trying to insert/update/delete etc on scoped application table then it would be blocked because of the Application Access Settings at table level.

By default when you create custom table in custom scope then only read operation is allowed outside the current scope

https://docs.servicenow.com/bundle/orlando-application-development/page/build/applications/reference...

https://docs.servicenow.com/bundle/orlando-application-development/page/build/applications/concept/c...

If you open your table and see the Application Access Settings then it would look like this OOB

Accessible from -  All application scopes

Can create -

Can update -

Can delete -

Can read - true

Note: Can update - if you enable this checkbox then it should allow you to update from other scope

Can create - if you enable this checkbox then it should allow you to insert from other scope

find_real_file.png

Mark the comment as a correct answer and helpful if this answers your question.
Regards
Ankur

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

Hi Ankur,

 

Thank you for your clear explanation. I tried as mentioned above but still I see same error.

 

Thanks,

Hema

Hi Hema,

please share your table config and script

can create and can update checkbox should be true

Regards
Ankur

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