- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2024 04:33 AM
I have created this article to help implementors and developers alike to identify how to limit and control access using ServiceNow Client Scripts.
ServiceNow Client Scripts is a very powerful tool of ServiceNow. It has broad capabilities that fully utilize the ServiceNow out-of-the-box libraries like g_form, g_user objects, and of course the JavaScript framework.
Some of the features it can do are the following:
- make fields hidden or visible
- make fields read only or writable
- make fields optional or mandatory based on the user's role
- set the value in one field based on the value in other fields
- modify the options in a choice list based on a user's role
- display messages based on a value in a field
To give you a better picture, let us drill down to the four steps:
Step one:
You can limit what an end user can see or view based on the role/group you created under user administration.
Step two:
Starting from the base access - no access, read only, edit , create and finally delete. - the granuality will differ based on the governance structure of the business.
Step three:
Utilize the g_user.hasRoleExactly('name of role') - this code identifies the currently logged in user has the role explicitly assigned.
Step four:
Get use of the g_form object to implement governance based on step two.
The four steps mentioned is a guide or your first step that will give you a picture of the power of Client Script. However, including the power of JavaScript you can manipulate the elements since the ServiceNow libraries sits in a browser that allows you to also fully configure the Document Object Model (DOM)
To give you a picture of how Client Script Works, i created this video for your visbility and guidance.
Here is How: ServiceNow Scripting: How to Create Client Scripts in ServiceNow
Please mark as helpful if you find the article lucrative.
Solved! Go to Solution.
- 1,012 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 06:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 10:51 AM
Good Explanation. Thanks for Sharing Knowledge.
Regards,
Nikhil Bajaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 06:48 PM