
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2024 12:33 PM
I am trying to auto-populate the MRVS using an OnSubmit client script. The client script does a bunch of calculations and then populates the MRVS. So when I submit the catalog item through the service portal, it works as intended and I can see the values being populated in MRVS in the RITM. But, when I submit the same catalog item from the native view, the mrvs doesn't seem to get populated.
My OnSubmit client script is set to work in "All" UI Types. I also validated if the client script is running, and it is running properly and generating the JSON object needed to populate the MRVS. This is how I am populating the MRVS.
g_form.setValue('mrvs_internal_name', JSON.stringify(result));
Version: Vancouver
Again, this works perfectly in service portal, so the client script code is correct.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2024 12:06 PM
A colleague help figure this one out, apparently onSubmit client script don't work on MRVS. In this case it seems it semi-works as I am able to use the onSubmit client script when submitting the request via Service Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2024 12:41 PM - edited ‎05-07-2024 12:43 PM
Hi @Akshay Palekar ,
Are you setting whole MRVS in one variable. Can you share the complete code.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2024 12:45 PM
Hi @AshishKM,
Thanks for your response. I did mention in my question itself that the OnSubmit script is set to "All" and is triggering correctly when I am trying to run it in the native view. But even with the client script running, the MRVS is not getting populated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2024 12:52 PM
I am building an object array, similar to this:
result = [{"var_1":"ABCSD","var_2":"20","var_3":"Critical"},{"var_1":"XYZ","var_2":"40","var_3":"High"},{"var_1":"PQRS","var_2":"5","var_3":"Low"},{"var_1":"YTRS","var_2":"40","var_3":"Critical"},{"var_1":"KJLM","var_2":"105","var_3":"Low"}]
Then just doing this:
g_form.setValue('mrvs_internal_name', JSON.stringify(result));

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2024 12:06 PM
A colleague help figure this one out, apparently onSubmit client script don't work on MRVS. In this case it seems it semi-works as I am able to use the onSubmit client script when submitting the request via Service Portal.