- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2025 02:36 AM
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
08-17-2025 04:56 AM - edited 08-17-2025 04:57 AM
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**
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2025 04:12 AM
You can refer below posts that are similar to your requirement,
If this helped to answer your query, please accept the solution and close the thread.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2025 04:56 AM - edited 08-17-2025 04:57 AM
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**
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2025 11:16 AM
@Alon Grod Did this work as expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2025 05:07 AM
Hi @Alon Grod
May you use script onLoad
function onLoad() {
// get value from catalog item variable
var catVar = g_form.getValue('u_catalog_ref');
// set that value into the MRVS first row (if it exists)
var mrvs = g_form.getValue('u_mrvs_variable');
if (mrvs) {
var rows = JSON.parse(mrvs);
if (rows.length > 0) {
rows[0].u_mrvs_ref = catVar; // copy value into MRVS reference variable
g_form.setValue('u_mrvs_variable', JSON.stringify(rows));
}
}
}