- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2016 09:45 PM
Hi All,
I am trying to populate value into a ui_reference field in my UI Page for service catalog.
Below is the code on UI page:
<g2:ui_reference name="u_exec_leadership_team" table="sys_user" value="$[test]" displayvalue="$[name]" onchange="setCartValue();" /> |
So, the page loads with value from "$[test]" and "$[name]" variable.
But I using onchange function in another field on the page to call a UI script function, which changes these value.
So the UI Script function does some evaluation and then set value of 'u_exec_leadership_team'. Below is the code, I used to set the value:
g_form.setValue('u_exec_leadership_team', sys_id);
This gives value to the UI Reference field but display shows as "undefined".
I have tried using "g_form.DisplayValue('u_exec_leadership_team', name);". But it still shows undefined and doesn't show the name.
"name" here is the corresponding name to the above used sys_id.
Am I using the correct syntax to set the Display value for UI page or there is some other method?
Please help.
Thanks
Shihab
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2016 12:30 AM
You can set the display value directly by doing
g_form.setValue('u_exec_leadership_team', sys_id,name);
Where "name" contains your display value.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2016 12:55 AM
I had done this in Fuji but not sure on newer versions.
gel('fieldname').value = 'sys id of record';
gel('sys_display.fieldname').value = 'display value of record';