- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2020 02:11 PM
Hey, team. I have a basic question, and I feel like I'm probably missing something super basic / simple.
I threw a simple script together:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var autoPop = g_form.getReference('system_display_name', autoFill);
function autoFill(autoPop) {
g_form.setValue('business_system_owner',autoPop.u_approvers_g3);
g_form.setValue('business_it_system_owner',autoPop.u_approvers_g2);
}
}
The u_approvers_g3/g2 are reference fields on the table where system_display_name is pulling. In theory, once they enter the value for system_display_name, it should add the two approvers to their specific fields. Instead, it populates an entirely blank value, and while the information button exists, if you click it, it shows that there is no display value available.
I tried to drill down deeper and added u_approvers_g3.user_name and that didn't work. I feel like I am just missing some piece, or a definition. I've modeled this script after another one that I use to populate user data, but it doesn't work here, while it works normally on any other place the user info is required.
Any help would be appreciated!
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2020 05:34 PM
Ok, and so is the reference fields for the business system owner and it system owner pointing to the same table as the u_approvers_g2/g3?
Because if the alert is showing a sys_id...then the getReference callback is working...now its down to an issue with that sys_id not working correctly in the business system owner and it system owner field...which makes me think the table is not the same...thus when the sys_id is trying to be set in there...it's not equaling a valid value...so instead...you see a "blank" with the info icon showing...but that is usually meaning it's "undefined"...so something is there...it's just not defined and so it shows blank with an info icon that goes to no record.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2020 10:24 AM
Hi,
As Allen suggested, add the alert statements and check. In general, if you are seeing the blank, then it would mean that for that specific record, either the values do not exist or the display column in that reference table is empty because of which you see empty.
Mark the comment as a correct answer and helpful if it helps.