g_form.DisplayBox('') is not working in the portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2022 04:47 AM
Hi All,
Actually, I need to get the value of the reference field. So I am using 'g_form.DisplayBox('')' but it not working in the portal and gives a javascript console error.
Can anyone help me with that?
Note: The field refers to the Service offering table and I need to auto-populate the service offering name in another field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2022 04:49 AM
I need to populate the field in the Catalog item form of the service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2022 04:54 AM
Hi,
Try using g_form.getReference() with callback function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2022 05:08 AM
onChange() Catalog Client Script on Reference variable
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.getReference('<reference_variable_backend_name>', callBack);
}
function callBack(gr){
alert(gr.getDisplayValue());
g_form.setValue('<backend_name_of_other_variable>', gr.getDisplayValue());
// If other variable is also reference type then you can utilize below line
//g_form.setValue('<backend_name_of_other_variable>', gr.sys_id);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2022 05:12 AM
Hi
We can use g_form. getDisplayValue(); on client side.
But condition is that "isolate script" checkbox set to false, it will not work when this field box set to true.
Mark Correct or helpful if it helps.
Thanks,
Shubham Verma