getValue() already restricted for scoped app?

Andrii ICL
Tera Contributor

Today I've got following message:

Screenshot 2025-02-25 at 18.58.28.png

I undersand it as getValue() is not allowed in scoped app. Do you have other understanding?

 

So in the morning my code worked and it looked like this:

Screenshot 2025-02-25 at 18.53.35.png

I want to highlight it ONE MORE TIME - it worked perfectly!

 

However few hours later I've got the message about about getValue() and I had to redo my code so it works again.

Now it looks like this:

Screenshot 2025-02-25 at 18.53.40.png

and IT WORKS!

 

Now, I have a very serious question to ServiceNow Platform - if this is a glitch - how can clients rely on the platform logic and how developers can develop reliable code ?

 

 

ServiceNow Documentation teaches us to use getValue in scoped app also: https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/app-store/dev_portal/API_referenc...

 

Screenshot 2025-02-25 at 19.08.31.png

2 REPLIES 2

Daniel Draes
ServiceNow Employee
ServiceNow Employee

As you are developing in a Scoped Application, that is a setting wether or not to enforce Cross Scope Privileges. Typically on a dev environment this is set to 'tracking'. Which means on every occasion a function or data element is used which resides outside your own scope (in this case GlideRecord.getValue), it would report that and track it in the app settings. When set to enforced though, it would not allow that call to happen UNLESS it is already in the Cross Scope Privileges section of your app.

Now I don't know exactly what happended in your instance, but this is at least where I would be starting to search.

Ankur Bawiskar
Tera Patron
Tera Patron

@Andrii ICL 

your script is running in your scope and the table is in global scope

I am able to get it irrespective of the Runtime access Tracking status

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