Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Catch Cross scope TABEL Assess Issues in Server Side Script - from Global any Scope

SteweLundin
Tera Contributor

Trying to catch when I get a Cross Scope issue when accessing a table from a script in global. 

All I want to do is know IF i cant access the requested table

If I do a GlideRecord or a GlideRecordSecure from Global to a Scope(any scope) where I have no priviliges there is no error thown. 
I get a legit but EMPTY GlideRecord - this alone is not sufficitent for me to catch as my result
- canRead, canWrite and canCreate  are return as true (using Admin). 
try {} catch(){} will not catch this. 

All I can see is a log entry saying that I have no Scope Priviliges. 

Any Ideas. 

And NO, setting up Scope Priviligies is NOT an option

4 REPLIES 4

Kieran Anson
Kilo Patron

GlideQuery can be used in a try catch and will throw an error if you're unable to write to a scope 

That is not an option unfortunately!

Interesting restriction, hope you find a solution 

Me to!
My "work around" at the moment is

If
!my_gr.hadNext()
and if application !=global

I will treat is as if I cant read it due to cross scope issues and it has to be checked manually or excluded from further exekutions.