On change client script issue for reference variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2022 02:54 PM
We have a table (cmdb_ci_appl) where there is no Display value.
we have a catalog item in which we have a reference field, on selecting the 1st field we need to populate the 3 other fields.
How to set the app ID ( which is highlighted) upon selecting? ( as of now it is defaulting to name , which is on the left side)
Below is the Onchange CS script ( for some reason when the ID is selected it is not setting the name in the name field (name is of string type on the table )
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var AppID = g_form.getReference('citrix_application_id', SetApplicationvariables);
function SetApplicationvariables(AppID) {
g_form.setValue('citrix_application_name', AppID.name);
g_form.setValue('citrix_application_version', AppID.version);
g_form.setValue('citrix_application_vendor_name', AppID.u_common_name);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2022 05:10 AM
Hi RudhraKAM
I've defined variables as below.
Executed the form. Selecting item in citrix_application_id field filled other fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 10:39 AM
If using the single-line text variable it is working but the requirement is for the application name should be reference field. and the name is not populating ( the variable is mandatory ) on change it is setting to something but it is not displaying , i say this because mandatory is off on change.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2022 10:28 PM