- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 10:46 AM
I'm working on a form on the Incident table and I need to hide a value from the a dropdown field. I have a reference field on the form from the CI table called Operational Status. Operational Status is an integer field with choices, one of which is "retired". When selecting an option in the Operational Status field on the Incident form, I need to remove the option to select "retired". How would I go about this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 03:35 AM
You can use Client Script for this.
Script:
function onLoad() {
var operationalStatusField = g_form.getField('operational_status');
if (operationalStatusField) {
var options = g_form.getOptions('operational_status');
for (var i = 0; i < options.length; i++) {
if (options[i].text.toLowerCase() == 'retired') {
g_form.removeOption('operational_status', options[i].value);
}
}
}
}
Pease mark this as helpful or correct if this helped you in your problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 10:51 AM
Hi Jamie,
You can do this with g_form.removeOption in a Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 10:57 AM
That was the first thing I tried. I made an onLoad client script of
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 11:01 AM
Yeah, when testing this I see that the dot-walking is not honoring this, or right-clicking on the label and configuring choices, which should also work. When you choose a CI it's showing the Operational Status from that record, so are you really looking to filter retired CIs from the Configuration item field, or are you trying to update the Operational status of a CI from the incident record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 11:04 AM
I'm looking to update the operational status of a CI from the Incident form. I don't want Retired to be a selectable option to update the CI.