- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2022 01:55 AM
Hi,
I am trying to figure out how to access a Client Script variable in the HTML code on a UI page.
My goal is to have a g:ui_reference field on the page which is prepopulated with a sys_id (and correct display value) that is fetched from a UI Action.
If I try to set the value with gel() or document.getElementById, it wont set the proper reference, just the string value..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2022 04:54 AM
To prepopulate from UI action, Please refer the sample code.
This UI page gets two URI parameter named sysparm_table_name & sysparm_sysid. In your case it should be sys_id of CI and display value.
UI Action
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2022 03:57 AM
You client script should be like below.
function createRelationship(){
alert(gel(base_ci_field).value);
alert(gel(target_cis_input).value);
}
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2022 04:54 AM
To prepopulate from UI action, Please refer the sample code.
This UI page gets two URI parameter named sysparm_table_name & sysparm_sysid. In your case it should be sys_id of CI and display value.
UI Action
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2022 04:01 AM
Use gel(sys_display.basic_ci_field).value=baseCIname;