GetReference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 02:58 AM
Hi to all,
I wanted to get from a table application, the value of on column by which I check the state true or false of the column, while this table application is referenced in a field of my catalog item. , let's say the column nam is u_purchase_licence.
So my need was to check in the portal if the selected application has a true or false value u_purchase_licence. I went first with a business rule, and changed in order to do i client script
I decided now to go with a client script, but I still not get the correct script to really control the display with the application chosen value with u_purchase_licence == true.
Here is my code:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
g_form.setDisplay('alert_application', false);
}
//Type appropriate comment here, and begin script below
g_form.getReference('u_purchase_licence', doAlert); // doAlert is our callback function not cmdb_ci_app
}
function doAlert(caller) { // reference is passed into callback as first arguments
var list_appl = g_form.getValue('appl_request_access_choice');
if ((caller.getValue() == 'true') || (list_appl != '')) {
g_form.setDisplay('alert_application', true);
}
else {
g_form.setDisplay('alert_application', false);
}
}
If you can help me with this
Thanks