Hide Choices on contact_type field on HR Case based on Assignment group values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 08:31 AM
Hi Everyone,
I have a requirement where Assignment group is ABC or XYZ I need to hide 3 choices under Source (contact_type) field which is a reference field.
Hide only 2 choices and set a default value when assignment group is AAA or CCC - Need to do this for a couple of groups.
I have tried using removeOption on OnLoad script but realised it doesn't work on Reference fields.
How do I achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 12:55 PM
I believe you could add an advanced reference qualifier to your Source field, then point to a script include where you have your condition logic. Here is an example of what I'm thinking:
Have a great day!
Kristen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 01:19 PM
if it is reference field the you need to implement reference qualifier. Please check below to find how advanced reference qualifiers work.
https://servicenowguru.com/script-includes-scripting_advanced-reference-qualifier-script-include/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 01:29 PM
Hi @ImpuV ,
I have a requirement where Assignment group is ABC or XYZ I need to hide 3 choices under Source (contact_type) field which is a reference field. - > [you can create a script include and a reference qualifier to filter out the choices from reference field - Swathi]
Hide only 2 choices and set a default value when assignment group is AAA or CCC - Need to do this for a couple of groups. -> [In the same script include you can mention this point - Swathi ]
I have tried using removeOption on OnLoad script but realised it doesn't work on Reference fields.
How do I achieve this? -> [In the same script include create one more function and return the value and call this second function in Default value of assignment group this should auto populate the value -Swathi]
Let me know if you need help with the scripting , and please do share whatever you have tried so far with some screen shots.
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 01:08 AM
Hi Swati,
Thank your help.
I am trying to hide choices on this field and Set default value
For eg : Assignment group is AAA/ BBCv - Show 3 choices and set 'Phone' as Default value.
Assignment group is ABC - Show 5 choices and set 'Other' as default value.
28 assignment groups for which I need to show 3 choices and set 'Email' as default value.
based on the Assignment group. This is the Dictionary entry of the field. I have tried to hide options for the same field on INC form using addOption/removeOption. But it's not working for HR Case form.
I mistook this to be a Reference field. Apologies.