- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi,
i have a MRVS on my catalog item with two variables of type Reference. In addition, i have a variable of type reference on my catalog item itself. How can I populate one of the variables in the MRVS with the value of the variable in my catalog item. Both the variable from the MRVS and the variable from the catalog item are referenced to the same table
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago - last edited 4 weeks ago
This should be quite simple considering you will populate your catalog item variable before MRVS.
var user1 = g_service_catalog.parent.getValue("user"); // user is. variable in catalog item
g_form.setValue('user_mrvs', user1); // user_mrvs is varaiable on multi row variable set
** this is on load client script on MRVS**
**Note : The on Load client script works on MRVS when you click on Add button**
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi there @Alon Grod
write a catalog client script like this
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var catItemRef = g_form.getValue('catalog_item_ref_variable');
if (catItemRef) {
var mrvs = g_form.getValue('needed_variables');
var mrvsObj = JSON.parse(mrvs);
if (mrvsObj.length > 0) {
mrvsObj[0].hidden_catalog_item_id = catItemRef;
} else {
mrvsObj.push({
hidden_catalog_item_id: catItemRef
});
}
g_form.setValue('needed_variables', JSON.stringify(mrvsObj));
}
}
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India