- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2025 11:04 PM
I have a Multi-Row Variable Set (MRVS) in a record producer, and I'm trying to populate a variable outside the MRVS using an onChange client script. However, my script is not working as expected, and the variable is not getting updated.
Set value function is not working
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 09:35 AM
For whatever reason g_service_catalog does not (yet?) have a setValue method, only getValue. You can set the value of a variable outside of the MRVS with a script like this, for the native UI and/or Service Portal/ESC/...
if (this) { //Service Portal method
this.cat_g_form.setValue('advance_amount', '12');
} else { //native UI method
parent.g_form.setValue('advance_amount', '12');
}
If you are using Service Portal, etc. you will also need this onLoad Catalog Client Script that Applies to the Catalog Item / Record Producer, not the MRVS:
function onLoad() {
if (this) {//we only need to do this for Service Portal
//We need to make the g_form object for the parent item available from the MRVS window
this.cat_g_form = g_form;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 09:35 AM
For whatever reason g_service_catalog does not (yet?) have a setValue method, only getValue. You can set the value of a variable outside of the MRVS with a script like this, for the native UI and/or Service Portal/ESC/...
if (this) { //Service Portal method
this.cat_g_form.setValue('advance_amount', '12');
} else { //native UI method
parent.g_form.setValue('advance_amount', '12');
}
If you are using Service Portal, etc. you will also need this onLoad Catalog Client Script that Applies to the Catalog Item / Record Producer, not the MRVS:
function onLoad() {
if (this) {//we only need to do this for Service Portal
//We need to make the g_form object for the parent item available from the MRVS window
this.cat_g_form = g_form;
}
}