- 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 08:01 AM
Hi @cassie-le ,
Description
g_form.modified, g_form.modifiedFields, g_form.getControl('field_name').changed, g_form.getElement('field').changed APIs will not work in agent workspace.
Cause
At this time there are no exposed APIs on g_form to check if the form has been modified in the Agent Workspace. This is by design. This will be a product enhancement in the workspace platform.
Resolution
You will need to utilize g_scratchpad to detect changes in the value of a field in the form. The g_scratchpad object passes information from the server to the client, such as when the client requires information not available on the form. You can refer the following documentation for more information.
You will need to create a Display business rule to access the field value and store in g_scratchpad.FIELD_NAME.
g_scratchpad.FIELD_NAME = current.FIELD_NAME;
Once that is done, I can write a script like the following to detect any changes in the value of the field.
if(g_scratchpad.FIELD_NAME != g_form.getValue('FIELD_NAME')) {
alert('FIELD_NAME changed');
} else {
alert('FIELD_NAME unchanged');
}
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda