- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2020 02:12 AM
Hi,
Actually I need to show/hide options on one field based on another field.
I can achieve this using g_form.clearOptions() , addOption() & removeOption(). But, its actually removing or adding options.
Is there any other way available to show or hide options other than the above specified. ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2020 02:50 AM
Hi Prabhu,
you should create entry into UI messages table for those drop down values and adding option should be possible using getMessage()
refer below links for help
translations for onChange catalog client script through getmessage() method not working
Coding Help for retrieving the value from sys_message table
How to use gs.getMessage() to get the string translated?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2020 03:56 AM
Hi,
for all options you need to create entry into that messages table
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2020 04:04 AM
Hi Ankur,
Yes, I have created 3 records in Messages table, though its getting translated value only for option 1. I don't know why its not showing values for options 2 & 3.
With Regards,
Prabhu V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2020 04:12 AM
Hi Prabhu,
try to logout and login again
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2020 04:19 AM
Hi Ankur,
Thanks for your support.!
Its working fine now, actually I have modified the getMessage() to be outside of if statement and assigned it to temporary variables.
Regards,
Prabhu V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2020 05:01 AM
You are welcome.
Do remember to mark responses which helped you as helpful.
Happy learning.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader