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.

How to access custom objects defined from the global UI Script in UI16 frame banner?

stinky2nine
Tera Contributor

How to access custom objects defined from the global UI Script in UI16 frame banner?

It seems like the new UI16 frame banner is now using Angler? I've this test global UI Script that works just fine in UI15 but not in UI16.

foo = {};

foo.helloWorld = function() {

  console.log("Hello World!");

};

However, when you try to call foo.helloWorld() on the new UI16, you will get this error:

Screen Shot 2016-04-01 at 2.42.39 PM.png

Solution:

The global object are applicable to gsft_main only. So use gsft_main.obj...

Screen Shot 2016-04-01 at 3.04.35 PM.png

1 ACCEPTED SOLUTION

rakesh_ravi
ServiceNow Employee
ServiceNow Employee

Have you switched your iframe to gsft_main in browser console. The global object are applicable to gsft_main only.



Let me know in case that still did not solve your problem.


Hope this helps.


View solution in original post

2 REPLIES 2

rakesh_ravi
ServiceNow Employee
ServiceNow Employee

Have you switched your iframe to gsft_main in browser console. The global object are applicable to gsft_main only.



Let me know in case that still did not solve your problem.


Hope this helps.


venkatiyer1
Giga Guru

Hi Alex,



While doing the console hope you are pointing to right frame. On the top right you should be choosing the main frame or gsft_main instead of top.