- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 09:37 AM
I have the below variable in a catalog item called from_division.
This variable is auto- populated
I have another variable of type Yes/No called ABC _Employee. If ABC_Employee is yes, then I want to update the from_division variable to a specific value of "ABC" from the department table. What is the best approach?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 09:15 PM
if you know the department sysId then simply hard-code but don't use GlideRecord
For best practice, story that sysId in system property and use GlideAjax to get that and then set in client script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
if (newValue == 'Yes')
g_form.setValue('from_division', 'sysId');
else
g_form.clearValue('from_division');
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 06:07 AM
Hi @Anu_Arv
Use the onchange client script and set the value, it's best one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 07:13 AM
@Dr Atul - LNG I tried using an onchange client script but didn't seem to work. Can you take a look and let me know if you see any issues with my script? It doesn't seem to update the value when the value is set to Yes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 11:30 AM
@AshishKM need help here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 11:53 AM