- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 08:18 AM
Hi Team,
I am trying to pass multirow variable set values to list field on the target record but those are not setting the correct values.
i am using the record producer script like below.
in my target record, u_factory_systems is a list type field with choices, choices sys_id's are mentined in the push line in the script.
can anyone please correct my script?
Thanks in advance,
Hari Kishan.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 09:32 AM
You need to get the value of the MRVS, which will be a JSON of all the rows, then loop through it to push the sys_ids to the array if each variable of each row is true.
So start with something like this:
var arr=[];
var mrvs = producer.factory_systems;
var rowCount = mrvs.getRowCount();
for (var i=0; i<rowCount; i++) {
var row = mrvs.getRow(i);
if (row.ipw == "true") {
arr.push('aad7c94f1b83a4500c86cbb4604bcbfe');
}
if (row.infact == "true") {
arr.push (...
}
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 09:32 AM
You need to get the value of the MRVS, which will be a JSON of all the rows, then loop through it to push the sys_ids to the array if each variable of each row is true.
So start with something like this:
var arr=[];
var mrvs = producer.factory_systems;
var rowCount = mrvs.getRowCount();
for (var i=0; i<rowCount; i++) {
var row = mrvs.getRow(i);
if (row.ipw == "true") {
arr.push('aad7c94f1b83a4500c86cbb4604bcbfe');
}
if (row.infact == "true") {
arr.push (...
}
...