- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2020 03:58 AM
Hi Team,
Can anyone please help , How to do Map to field on MRVS ,there is no direct option, is there anyway to achieve.
Regards,
Saridha.L.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2020 06:11 AM
try with below code , i have added log as well. so check the log if it does not work, and let me know the log result as well
var mrvs = JSON.parse(producer.journal_entry_line_items);
var rowCount = mrvs.length;
gs.log('Length is '+ rowCount);
for (var i = 0; i < rowCount; i++) {
var gr = new GlideRecord('x_journal_entr_journal_entry');
gr.initialize();
gr.setValue('u_account', row.u_account);
gr.setValue('u_cost_center', row.u_cost_center);
gr.insert();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2020 06:21 AM
It should be like this:
var mrvs = JSON.parse(producer.journal_entry_line_items);
for (var i = 0; i < mrvs.length ; i++) {
var gr = new GlideRecord('x_journal_entr_journal_entry');
gr.initialize();
gr.setValue('u_account', mrvs[i].u_account);
gr.setValue('u_cost_center', mrvs[i].u_cost_center);
gr.insert();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2021 09:23 AM
Having this same issue:
I have a MRVS on a record producer that I want the values added to map to the description field on the resulting HR case record. Below is an example of my MRVS with the fields that values are entered for.
The 2 variables in my MRVS are 'state' and 'allocation_percentage'
I tried using this UI Policy OnCondition script on the record producer but it did not work
function onCondition() {
var varName = JSON.parse(producer.state_withholding_elections);
var description = '';
for (var i = 0; i < varName.length; i++) {
description += "\n state: " + varName[i].state + "\n allocation_percentage: " + varName[i].allocation_percentage + "\n";
}
current.case_field = description;
}