Getting Error - MRVS Data fetch RITM to catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 07:59 AM
I am trying to copy the MRVS data from an existing RITM and put it in a new catalog item by using GlideAjax, and when I am trying to put the request in the cart or submit, it gives me an error: "Something went wrong on your request; it could not be submitted. Please contact your system administration."
I used the following method, but it didn't work. Does anyone have a solution for this or have come across this issue before?
Server side -
getMRVS:function(){
//var aa={};
var gr=new GlideRecord('sc_req_item');
gr.get('444db8712f96b01042162b5df699b654');
var mrv=gr.variables.my_values.toString();
return JSON.stringify(mrv);
}Client side -
var gr=new GlideAjax('AjaxUtil');
gr.addParam('sysparm_name','getMRVS');
gr.getXML(GetMRVS);
function GetMRVS(response){
var answer = response.responseXML.documentElement.getAttribute("answer");
var mrv=JSON.parse(answer);
console.log(mrv);
g_form.setValue('my_values',mrv);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2024 12:22 PM
Do you see the MRVS rows populated correctly before submitting? Try logging the contents of what you are retrieving:
getMRVS: function() {
var mrv = '';
var gr = new GlideRecord('sc_req_item');
if (gr.get('444db8712f96b01042162b5df699b654')) {
mrv = gr.variables.my_values.toString();
}
gs.addInfoMessage(mrv);
return mrv;
},
Is it formatted like this?
Or are the [] missing, or are there extra " or other formatting characters,...? Are you using the native UI, or Service Portal / ESC / ...? If you look in the browser tools, do you see any errors in the console log?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2024 10:59 PM
@Brad Bowman : Thanks for seeing the issue in dept. We are using ESC.
Following response I get
It is really strange why I am getting this issue as I am following standard scripting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2024 04:09 AM - edited 03-29-2024 05:57 AM
I don't have ESC, but it should be similar to Service Portal. Are you able to try the same there, and/or in the native UI. I tried my example in Service Portal, got the same console errors/messages, but it worked. Do you see anything in the system log when this attempt is made? If you edit and save each row, without necessarily changing anything does it work? Another thing to try is a simple example - so on the RITM you are retrieving, populate one variable in one row to see if that works. Are any of the MRVS variables mandatory? I know I have encountered this problem before - not sure if it was when populating a MRVS, or something else, but I can't think right now what the resolution was, or if I found a workaround. I'll keep thinking on that.
