- 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
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
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
3 weeks ago
@Alon Grod Did this work as expected
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
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));
}
}
}