- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 03:21 AM
Hi,
Is it possible to make one value in State "read only". What im trying to accomplish is to make State "New" read only for incident, so that this state isn't possible to set manually, only by rules..
Anyone tried anything similar?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 03:25 AM
Sorry Anders. It's a function of most browsers that choice lists (aka select lists) display the values they have. You could use an onLoad client script to remove the option.
g_form.removeOption('state', 'New'); //Adjust New to the proper state VALUE, e.g. 1)
Reference:
GlideForm (g form) - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 03:25 AM
Sorry Anders. It's a function of most browsers that choice lists (aka select lists) display the values they have. You could use an onLoad client script to remove the option.
g_form.removeOption('state', 'New'); //Adjust New to the proper state VALUE, e.g. 1)
Reference:
GlideForm (g form) - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 03:31 AM
But this will remove the option? When State = New i want users to see this, but that it shouldn't be able to choose this state after it's moved to another State (assigned)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 03:48 AM
I have disccused it with the customer now. I think i can use this solution. Just have a condition that says if state != New, remove the option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 03:25 AM
You can create a new client script for "Incident" table with "onload" event. Then you can disable that option using below 2 lines.
var statefield = g_form.getElement("state");
statefield.options[0].setAttribute("disabled","true");
Assumption is "New" option will be first option, which is usually. If not, you need to iterate through and find.