Fix script to change the table label and its column label

maitripatel
ServiceNow Employee
ServiceNow Employee

I am creating a fix script to change a table's label (in my app scope) and its column label upon upgradation, I am doing it by querying the sys_db_object and sys_dictionary table and then using .update() to change the table label. When I try to run the fix script I get an error: 

GlideSession message was modified by sanitization. [message=Write operation against 'sys_db_object' from scope '<my_app_scope>' has been refused due to the table's cross-scope access policy][sanitized=Write operation against &#39;sys_db_object&#39; from scope &#39;<my_app_scope>&#39; has been refused due to the table&#39;s cross-scope access policy]
Security restricted: Write operation against 'sys_db_object' from scope '<my_app_scope>' has been refused due to the table's cross-scope access policy

 What should I do, it runs if the fix script is created in global scope but I need it in my application scope so I can ship the application. 

4 REPLIES 4

GlideFather
Tera Patron

Hi @maitripatel 

can you confirm that the fix script is written in the same scope?

GlideFather_0-1754743499740.png

 

Eventually you can test it in PDI using a background script, there is also a choice to select scope.

 

Let me know about your progress

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Hey @GlideFather 

 

Yes, the fix script is written in the same scope i.e. my_app_scope. I tried running it but it shows the same error. I tried creating a cross-scope privilege for the same but no luck

Ankur Bawiskar
Tera Patron
Tera Patron

@maitripatel 

But why using script and complicate when it can be done easily from UI?

Simply change the table label in sys_db_object

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

I am using a script to ensure that my table labels are changed during app upgrade scenario