Is it possible to copy multi-row variable data to another MVRS?

Nagashree5
Tera Contributor

Hi All,

 

I have build a catalog item which has a MVRS and on submit of this it creates a RITM. Now, there is one more catalog where they select the closed RITM's and it has to copy the closed RITM MVRS values to form level MVRS. 

I have some code that will copy the variables from the Requested Item to the form level, but I just noticed that it is not copying over the multi-row variable set information.  Multi Row Question Answer table [sc_multi_row_question_answer] has the values in it but I'm unable to copy them.

Has anyone come across this before? Is there an easy way to copy this data?

 

Thank you in Advance.

7 REPLIES 7

Anil Lande
Kilo Patron

Hi,

Can you please elaborate more?

Where exactly MRVS values are stored and where you want to set?

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Hi @Anil Lande ,

 

I want to copy the MVRS Variable set values from a closed RITM to the form level. I'm able to copy the variables from the closed RITM to the form level but I'm unable to copy the MVRS values.

 

Can you please share what you have tried, it would be helpful to suggest changes to your code. 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

To set MRVS Values you need to query the RITM table and pass the JSON from closed RITM to form using Glide Ajax.

You can get variables and pass JSON

In server side script use:

 

in client script you can use this returned Array of JSON to set MRVS  like below:

g_form.setVlaue('mrvs_name', 'returned JSON');

 

A hardcoded example would be:

function onSubmit() {
   var additional_users = [ {
  "user_nm" : "dcdcscs"
}, {
  "user_nm" : "dvdsc"
} ];
	
	g_form.setValue('additional_users',JSON.stringify(additional_users));
   
}

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande