- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 04:16 AM
Hello, I have a variable (type reference) which is called territory. Based on the selection of a given territory, another field (CISO group) should be autopopulated. I was working on the client script below but it hasn't worked so far. Any clues? suggestions?
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var territory = g_form.getReference('territory', callback);
function callback(territory) { //reference is passed into callback as first arguments
g_form.setValue('ciso_group',territory.sys_user_group);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 04:42 AM
g_form.setValue('ciso_group',territory.u_ciso_group);
Did this not work? What type of variable is ciso_group? is it a reference variable or single line test?
also try to do alert(territory.u_ciso_group); in your function to check what are you getting.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 04:42 AM
g_form.setValue('ciso_group',territory.u_ciso_group);
Did this not work? What type of variable is ciso_group? is it a reference variable or single line test?
also try to do alert(territory.u_ciso_group); in your function to check what are you getting.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 04:50 AM
Thank you, RaghavSh!
It looks like it is working (see image below). The ciso group is displayed in the RITM I created to test. I guess I was expeting to see it autopopulate in the form while I was creating it. Any clues as to how to do that? I'll give the alert a try to make it more visual.
Thank you! 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 04:52 AM
Dismiss my previous comment, it's working just fine in the form itself. I'll give it a couple of tweaks so as not to get the sys_id.
THANK YOU!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 05:30 AM
Sure, if this is resolved, you can mark the relevant answer correct to close the thread.
Raghav
MVP 2023