We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Getting Error with Cross Scope Table Access

Aniket Bhanse
Tera Guru

Hi all,

 

I have an HR Service (Human Resource: Core Application) and I have an OnLoad Client which should be inserting some details in the "sys_user_preference" table (global scope) whenever the user loads(opens) the HR Service. 

However I am getting the Cross Scope Error which says "Error: Write operation against 'sys_user_preference' from scope 'sn_hr_core' has been refused due to the table's cross-scope access policy

 

I have checked the Cross Scope and have already created two Cross Scopes as below:

AniketBhanse_0-1715071359974.png

 

I have also checked the "sys_user_preference" table and it has the access of "Can Read" and "Can Write" from all application scope:

AniketBhanse_1-1715071545808.png

 

 

(Note: This is the issue for all Users except Admins)

 

What could be the issue in such case and how do we fix this?

 

Thank you

 

1 ACCEPTED SOLUTION

Aniket Bhanse
Tera Guru

I figured it out!

In the User Preference table, the checkbox "Can Create" was enabled however "Can Update" was disabled due to which the sys_user_preference record was not getting updated. I even tried updating the record using script include (as I had my code in the script include) however it was still not updating. 

 

And when I enabled "Can Update", I was not getting the error and also the record was successfully updating in the User Preference record.

 

View solution in original post

7 REPLIES 7

Try checking below link:

https://www.servicenow.com/community/hrsd-blog/how-to-fix-the-red-popup-quot-must-declare-a-cross-sc...

 

If my answer has helped you in any way please mark it as correct or helpful.

I tried doing the same. I am still getting the same error when I try to create the RCA Record

AniketBhanse_0-1715075899009.png

 

Aniket Bhanse
Tera Guru

I figured it out!

In the User Preference table, the checkbox "Can Create" was enabled however "Can Update" was disabled due to which the sys_user_preference record was not getting updated. I even tried updating the record using script include (as I had my code in the script include) however it was still not updating. 

 

And when I enabled "Can Update", I was not getting the error and also the record was successfully updating in the User Preference record.