How do I access global properties from a scoped application?

Lucas VW
Tera Contributor

I am trying to get my instance url via script in a scoped application. However, I keep getting the following error:

com.glide.script.fencing.CrossScopeAccessNotAllowedException: Access to Glide API: properties from scope x_pnnla_siteaccess not allowed
Caused by error in <refname> at line 1

==> 1: var url = gs.getProperty('glide.servlet.uri');
2: gs.info(url);

How do I access the instance url from a scoped application?

5 REPLIES 5

Balaji Jagannat
Kilo Guru

On your application " x_pnnla_siteaccess", under "Application Access", can you confirm "Accessible from All Application" is selected with Read attribute checked?

 

I'm trying to access a global property from the scoped application, not the other way around.

Michael Jones -
Giga Sage

So, strange question, have you tried running the same multiple times? I've noticed that I sometimes seen an error like this the first time I try to access something in Global from a scoped application, then when I try a second time it seems to work.

I just tried this in a PDI, as a background script, with the scope for x_snc_social_media selected. 

var url = gs.getProperty('glide.servlet.uri');
gs.info(url);

I see this: 

Security restricted: Execute operation on API 'Glide API: properties' from scope 'Social Media Management' was granted and added to 'Social Media Management' cross scope privileges
x_snc_social_media: https://devxxxx.service-now.com/

When I run it a second time, I see:

x_snc_social_media: https://devxxxx.service-now.com/
Might just be a thing?

If this was helpful, or correct, please be kind and remember to mark appropriately.


I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

I've tried the script multiple times without success. Thanks though.