- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
while i was trying to make use of gs.hasRoleExactly('any_role') it was actually returning undefined can anyone please explain this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The hasRoleExactly method is not defined in the GlideSystem API, so that makes it undefined.
On client-side scripts you can use the GlideUser API: g_user.hasRoleExactly...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @Jagadeesh_Maddi ,
hasRoleExactly() can be used in the client side scripting using g_form.hasRoleExactly()
The GlideUser (g_user) Class | ServiceNow Developers
On server-side scripting, you can use gs.hasRole().
If my response helped, please mark it as the accepted solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
@Brad Bowman and @miftikhar20 have answered your question.
Also this is one of important question for CAD certification . I have discussed about it in my article, you can have a read about it:
Thanks and Regards,
Mohammed Zakir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The hasRoleExactly method is not defined in the GlideSystem API, so that makes it undefined.
On client-side scripts you can use the GlideUser API: g_user.hasRoleExactly...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @Jagadeesh_Maddi ,
hasRoleExactly() can be used in the client side scripting using g_form.hasRoleExactly()
The GlideUser (g_user) Class | ServiceNow Developers
On server-side scripting, you can use gs.hasRole().
If my response helped, please mark it as the accepted solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
@Brad Bowman and @miftikhar20 have answered your question.
Also this is one of important question for CAD certification . I have discussed about it in my article, you can have a read about it:
Thanks and Regards,
Mohammed Zakir
