MRVS issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Query:
There are two MRVS,where by adding one row, should automatically add row in second MRVS. Also there is lot of restriction imposed , not supporting DOM.
Approach 1 :Failed
I tried to pass whole JSON from first MRVS to other MRVS through setvalue but did not work. Not able to access second mrvs within first MRVS.
Approach 2 :Failed
I tried to create the temporary variable outside the MRVS on the catalog item but even that did not work.
Please let us the know the better solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @Keerthika2
Create an onChange Catalog Client Script
- Variable set: Select the first MRVS(mrvs_one).
- Variable name: Choose a variable inside the first MRVS that triggers the change .
- Type: onChange
function onChange(control, oldValue, newValue, isLoading)
{
if (isLoading || newValue === '')
{
return;
}
var mrvs1 = g_form.getValue('mrvs_one');
var mrvs1 = g_form.getValue('mrvs_one');
var mrvs2 = JSON.parse(g_form.getValue('mrvs_two'));
var newRow = mrvs1[mrvs1.length - 1];
var rowToPush = { 'variable_a_mrvs2': newRow.variable_a_mrvs1,
'variable_b_mrvs2': newRow.variable_b_mrvs1
mrvs2.push(rowToPush);
g_form.setValue('mrvs_two', JSON.stringify(mrvs2));
}
refer: Auto add row to multi row variable set
