- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 09:21 AM
Hi,
I'm working on a UI page that has the following sections:
HTML
<g:ui_reference name="QUERY:release=${jvar_release_gr}^status!=rejected^channel.testchannel=false^channel.channeltype=TV standard" id="assigned_to" table="x_inpt3_channel" onchange="doMyOnChange()" />
//The input field value is based on attribute of the record chosen above in the ui_reference
<g:ui_input_field label="channelID" name="channelID" value="?????" size="50" readonly="true"/>
Client script
function doMyOnChange() {
//Use the record chosen in the ui_reference
}
I have the following questions:
- How can I use one of the attributes of the record chosen in the ui_reference as the value for the ui_input_field?
- How can I pass the record chosen in the ui_reference to the doMyOnChange() function in the client script?
- In ui_reference, is it possible to replace the parameter "name=QUERY:" by the "query" parameter? If yes, how do we handle all the special characters?
Thank you
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 09:36 AM
If you have
<g:ui_reference name="selected_incident" id="selected_incident" table="sn_si_incident" onchange="enablePreview()"/>
You should be able to use can use
//Client side
var sec_inc_sid = gel('selected_incident').value;
//or
document.getElementById('selected_incident')
//Processing script
var x = request.getParameter("selected_incident")
The existing UI Pages have lots of examples.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 09:36 AM
If you have
<g:ui_reference name="selected_incident" id="selected_incident" table="sn_si_incident" onchange="enablePreview()"/>
You should be able to use can use
//Client side
var sec_inc_sid = gel('selected_incident').value;
//or
document.getElementById('selected_incident')
//Processing script
var x = request.getParameter("selected_incident")
The existing UI Pages have lots of examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 09:40 AM
In my example, it does not work because the "name" element is actually the QUERY.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 10:07 AM
Then change it so it has a proper name and id attribute and use the query attribute for the actual query you want to use.
You can look at the "add_to_app_dialog" UI Page to see how they did a dynamic query.
There are lots of UI Pages that you can use as examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2023 02:59 AM
Hi @DrewW
I am getting same issue my lookup not working while adding multiple condition by sapreting the AND in query
<g:ui_reference name="oldCiReference" id="oldCiReference" query="status==5^location==location " table="u_cmdb_toc_devices" onChange="getCiValuesOld()" />
</td>
If i remove the AND condition location ==location then the lookup working fine could you suggest