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

Rakhi Seth
Kilo Contributor

I need to get the UserAgent string in Script include of my project but facing cross scoped application access.

how do I access UserAgent details in cross scoped application?

below query is working in Global scope

var userAgent = '' + gs.getSession().getProperty('user-agent');

but when I am trying to access from my scoped application I am getting below error

com.glide.script.RhinoEcmaError: Cannot find function getProperty in object com.glide.script.fencing.ScopedGlideSession@10dfda2.
   script : Line(1) column(0)
==>   1: var userAgent = '' + gs.getSession().getProperty('user-agent');
      2: gs.log(userAgent);