Multi row variable set

chintuchairmen
Tera Contributor

Hi Everyone, 

I have a requirement i want the value of mukti row variable set to be captured on a string field in native UI means backend form.

 

Exampley i have a mrvs set on record producer i want the values of this variable set to be mapped to a string field on the table.

 

Kindly help with this. scenario

2 ACCEPTED SOLUTIONS

Muhammad Khan
Mega Sage
Mega Sage

In case if you want those to be populated to the field of the same table on which record producer is created, then try utilizing below record producer script.

var mrvs = JSON.parse(producer.<mrvs_backend_name>);

var str = '';
for (var j = 0; j < mrvs.length; j++) {
    str += mrvs[j].<variable_1_backend_name> + ' ' + mrvs[j].<variable_2_backend_name> + '\n';
}
current.<string_field_backend_name> = str;  // e.g. current.description = str;

 

If you want this for another table, then you might have to do GlideRecord on that table and populate as per your need.

View solution in original post

Brad Bowman
Kilo Patron
Kilo Patron

In the Script field on the Record Producer, this will copy the contents of the MRVS in JSON format (with a bunch of brackets and parenthesis)

current.string_field_name = producer.mrvs_internal_name;

If you want the value in the string field to look more readable, you could do something like this:

var arr=[];
var mrvs = producer.mrvs1;
var rowCount = mrvs.getRowCount();
for(var i=0;i<rowCount;i++){
	var row = mrvs.getRow(i);
	arr.push("year= " + row.year + ", choice= " + row.select);
}
current.u_due_date_term_type = arr.join('\n');

Where mrvs1 is the mrvs internal name, and year and choice are the variable labels in the MRVS, and year and select are the variable names in the MRVS.

View solution in original post

4 REPLIES 4

Muhammad Khan
Mega Sage
Mega Sage

In case if you want those to be populated to the field of the same table on which record producer is created, then try utilizing below record producer script.

var mrvs = JSON.parse(producer.<mrvs_backend_name>);

var str = '';
for (var j = 0; j < mrvs.length; j++) {
    str += mrvs[j].<variable_1_backend_name> + ' ' + mrvs[j].<variable_2_backend_name> + '\n';
}
current.<string_field_backend_name> = str;  // e.g. current.description = str;

 

If you want this for another table, then you might have to do GlideRecord on that table and populate as per your need.

working thanks a lot

Brad Bowman
Kilo Patron
Kilo Patron

In the Script field on the Record Producer, this will copy the contents of the MRVS in JSON format (with a bunch of brackets and parenthesis)

current.string_field_name = producer.mrvs_internal_name;

If you want the value in the string field to look more readable, you could do something like this:

var arr=[];
var mrvs = producer.mrvs1;
var rowCount = mrvs.getRowCount();
for(var i=0;i<rowCount;i++){
	var row = mrvs.getRow(i);
	arr.push("year= " + row.year + ", choice= " + row.select);
}
current.u_due_date_term_type = arr.join('\n');

Where mrvs1 is the mrvs internal name, and year and choice are the variable labels in the MRVS, and year and select are the variable names in the MRVS.

chintuchairmen
Tera Contributor

working thanks a lot.