- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 12:45 AM
I have a requirement in which a field in MRVS should only be visible in RITM and not in Service catalog view. I have to stop the submission of the RITM form if the field is empty. I have tried making the field mandatory in RITM view but it does not work(the RITM gets submitted anyway). Is there any way to access the values of MRVS using a client script or business rule on RITM?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 01:54 AM
Hi Chintha,
You can use the below code in your Business Rule to validate the values or MRVS
var mrvs = current.variables.test_var; // here test_var is the name of my MRVS.
// to access the variables inside your MRVS below code can help. For example you have a variable called Name in your MRVS then you can access it like this:
var total = mrvs.getRowCount(); // get the row count of mrvs
for(var i =0;i<total;i++)
{
current.short_description = mrvs[i].name; //set the short description of RITM with mrvs data. Here 'name' is a variable on my mrvs.
}
Please mark this as correct and helpful if it resolved the query or lead you in right direction.
Thanks,
Mohit Kaushik
Community Rising Star 2022
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 01:54 AM
Hi Chintha,
You can use the below code in your Business Rule to validate the values or MRVS
var mrvs = current.variables.test_var; // here test_var is the name of my MRVS.
// to access the variables inside your MRVS below code can help. For example you have a variable called Name in your MRVS then you can access it like this:
var total = mrvs.getRowCount(); // get the row count of mrvs
for(var i =0;i<total;i++)
{
current.short_description = mrvs[i].name; //set the short description of RITM with mrvs data. Here 'name' is a variable on my mrvs.
}
Please mark this as correct and helpful if it resolved the query or lead you in right direction.
Thanks,
Mohit Kaushik
Community Rising Star 2022
Mohit Kaushik
ServiceNow MVP (2023-2025)