Client scripts on new ServiceNow Agent vs Classic Mobile app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2019 06:14 AM
I am trying to remove an option from a choice list on the new mobile app, based on the role of the signed in user. Instance is upgraded to Madrid.
The script is working on the Classic Mobile app - removing one of the options from the choice list. But it doesnt do anything when i connect to the same instance from the new ServiceNow Agent mobile app.
The script looks like this:
function onLoad() {
//Get logged in user roles
var user = g_user.hasRoleExactly('itil');
var admin = g_user.hasRoleExactly('admin');
if(user == false || admin == false){
g_form.removeOption('u_state','8');
}
}
Help will be much appreciated.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 01:26 PM
Did you get an answer for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 07:10 AM
I have the same problem. In the documentation of ServiceNow I read that not all GlideRecord methods are suitable for the mobile app.
A suggested solution would be great.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2019 11:48 AM
try
function onLoad() {
//Get logged in user roles
var user = g_user.hasRoleExactly('itil');
var admin = g_user.hasRoleExactly('admin');
if(user == false && admin == false){
g_form.removeOption('u_state','8');
}
}