- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2024 03:46 AM - edited ‎04-12-2024 03:50 AM
Hi... I have converted one normal reference field 'control' to multiple references... so, i used multirow variable set and changed the field.
Example: when we select one control(reference filed). it will auto populate control number and control objective.
for this i created cataiog client script and one script include and populated data correctly on catalog form. after ritm creation variables displaying correcly in MRVS.
when iam passing control sysid through postman application i can get only control details, remain two fileds are coming null values.
Now i want to update those two mrvs fields data after RITM request creation using after insert business rule.
How can i write the business rule and populate data correctly on RITM , please help anyone.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2024 10:46 AM
In a Business Rule on the sc_req_item table, you can get/set the value of a MRVS using current.variables.mrvs_internal_name, so you can either replace the value with all three variables as it sounds like you were trying to do through postman, or get the value, then loop through each row updating the variables like this:
var mrvs = current.variables.mrvs_internal_name; //your MRVS name
var rowCount = mrvs.getRowCount();
for (var i=0; i<rowCount; i++) {
var row = mrvs.getRow(i);
row.v_mrvs1_model = "Dell 17 inch Monitor"; //mrvs variable name and value
row.v_mrvs1_class = "Peripheral";
}
current.update(); //only if running the Business Rule AFTER insert or update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2024 04:49 AM - edited ‎04-13-2024 09:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2024 10:46 AM
In a Business Rule on the sc_req_item table, you can get/set the value of a MRVS using current.variables.mrvs_internal_name, so you can either replace the value with all three variables as it sounds like you were trying to do through postman, or get the value, then loop through each row updating the variables like this:
var mrvs = current.variables.mrvs_internal_name; //your MRVS name
var rowCount = mrvs.getRowCount();
for (var i=0; i<rowCount; i++) {
var row = mrvs.getRow(i);
row.v_mrvs1_model = "Dell 17 inch Monitor"; //mrvs variable name and value
row.v_mrvs1_class = "Peripheral";
}
current.update(); //only if running the Business Rule AFTER insert or update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2024 04:49 AM - edited ‎04-13-2024 09:53 AM
Hi Brad,
Thanks for your reply.