getFields is not working in scoped application

kumarsatyam
Tera Expert

is there any substitute   of getFields in scoped application as it is giving error. Please specify the use . Can getFields can be used in Script Include (Scoped App) .

6 REPLIES 6

Harsh Vardhan
Giga Patron

check with thread below



Function X is not allowed in scope Y



Thanks,


Harshvardhan


Thanks for the help. I got the solution . It works on Script Include. Once again thanks.


Hi Kumar,



Can you post your solution here for the community? Are you invoking your script include from a scoped app?


Hello mehtaapoorv



I made the Script Include Public . If you don't want to use public script include then instead of that, in my case i used DOM manipulation as i was required to change the name of Section on demand . And in application scope DOM manipulation is not directly allowed for use so In the standard forms UI (eg client scripts, client ui actions) - by default, servicenow block access to the DOM and certain top-level globals (window, document, $ / jquery).



You can enable an application-specific property to gain access to the DOM. This provides a good trade off by setting a default with best practice guard rails, and allowing a developer to take explicit action to opt out of the best practice.



With the explicit property ServiceNow can:


On store submission, know that an app wants raw DOM manipulation and can pay more attention to it in the certification process Give it a lower "upgradability/maintainability" score Warn the developer on submission that they are going to need to re-certify the app on every major release, etc.



To opt out of the best practice create the following property in your scope and set it to false. glide.script.block.client.globals



Thanks



Kumar Satyam