- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 07:40 AM
I've added a state called "Under Review" - value = 20
I have managed to hide this from selection from users in the default view, but our analysts user the CSM/FSM configurable workspace.
I hid this using a client script below:
All posts I have seen say to use - UI Type = All - which it has and Isolate Script = True - which it also does.
I have put this into the global scope too and this is still the same.
We want to be able to use this state when something is updated by a customer but not allow our analysts to select it.
Currently on Utah.
Client script below:
Default view:
CSM/FSM workspace view:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 07:42 AM - edited 03-13-2024 07:43 AM
hi,
Why not just use the below in the script
g_form.removeOption('field name', 'choice value')
Try this and it should work in workspace as well as classic ui.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 07:42 AM - edited 03-13-2024 07:43 AM
hi,
Why not just use the below in the script
g_form.removeOption('field name', 'choice value')
Try this and it should work in workspace as well as classic ui.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 07:50 AM
Hey Anurag
That's great thank you! ... So I've got that to work.... but if the state is set to "Under Review" I still want the analysts to be able to see it just not select it in the list.
If it's set to that state, when I click on a case with the State = Under Review it shows blank - any ideas?
- Cassie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 07:57 AM - edited 03-13-2024 08:03 AM
Hi Cassie,
They woy to do this would be to add an onchange list on the field, if the value selected is under review you clear the value and add a message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 08:17 AM
Thanks Anurag I ended up with, I needed to call a variable and then do an If statement - the below works.
function onLoad() {
var options= Array.from(g_form.getControl('state')); //Set your target field
var hiddenOptions = ['20']; //Add your choice values to hide here.
var selectedChoice = g_form.getValue('state'); //Get the selected choice
if (selectedChoice != '20') {
g_form.removeOption('state', '20');
}
options.forEach(function(e){
if(hiddenOptions.indexOf(e.value) > -1)
e.hidden = true;
});
}