update field based on two reference fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 08:52 AM
Hi Experts,
I need to update a choice field based on two other reference fields on a HR case form.
What is the best approach for this
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 09:02 AM
Hi @si21 ,
You can achieve this by creating an onChange Client Script on the second reference field. Use the g_form.getValue() method to retrieve the sys_id of both reference fields, or use the g_form.getDisplayValue() method if display values are needed. Implement an if condition to check if the values of both reference fields match the desired criteria, and use g_form.setValue() to update the choice field accordingly.
If my response helped, please mark it as the accepted solution ✅ and give a thumbs up👍.
Thanks,
Anand