getFields in scoped app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2017 01:38 PM
We are developing in a scoped application and cannot use getFields(). How can we revise the below code so that it works in a scoped app?
var fields = gr.getFields();
gs.addInfoMessage(data.sys_id);
totalFields = fields.size();
for (var i=0; i<fields.size(); i++){
var glideElement = fields.get(i);
if(glideElement.hasValue()){
answeredFields++;
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2017 01:44 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2017 01:47 PM
Hi David,
getFields() is a function of GlideElement, which is globally accessible.
See http://wiki.servicenow.com/index.php?title=Scoped_System_API
Another thing, I wanna point out is getFields will work only with glide Objects like GlideRecord object or current in BR.