Attaching Knowledge Record to Incident

mdidrikson
Kilo Contributor

Hello,

We have noticed that in the Calgary release if we try and attach a Knowledge article to an Incident before submitting it, we receive the error:

Invalid action: Record needs to be saved first

Is there a way around this error? I believe this worked in earlier versions of ServiceNow.

Thanks!

Mark Didrikson

14 REPLIES 14

Thanks for the advice. The senior admins on my team like the idea and we are going to run with it.

Dustin


Hey CapaJC,

Not sure if I'm missing something but I just tried the change you suggested but still receive the same message "Invalid action: Record needs to be saved first". We just upgraded to Calgary last week and our Service Desk has just ran across the problem with attaching KB to an unsaved Incident. Here's part of our UI Script that I changed.

// attachIncident2 uses a Script Include, attachIncident uses an AJAX Script
function attachIncident2(x, target) {
if (self.opener) {
var lastSaved = self.opener.document.getElementById("onLoad_sys_updated_on").value;
if (false) {
self.close();
var err = (gel('error_msg')!=null)?gel('error_msg').value:"Invalid action: Record needs to be saved first";
self.opener.g_form.addErrorMessage(err);
return false;
}
var e = self.opener.document.getElementById("sys_uniqueValue")
var task = e.value;
}
var f = x.form;
var sysID = f.sys_id.value;
if (typeof sysID == "undefined") {
sysID = f.sys_id[0].value;
}
var args = new Array();
args.push(sysID);
args.push(target);

var ajax = new GlideAjax("KnowledgeAjax");
ajax.addParam("sysparm_type","kbAttachArticle");
ajax.addParam("sysparm_value",sysID + "," + task);
ajax.getXML(kbReturnAttach2, "", args);

return false;
}


Erik Nelson
Kilo Sage

We just rolled to Calgary in our production environment today and are seeing this prompt as well. If we do not turn it off, will this effect First Call Resolution Reporting since it is an edit after the initial save/resolve?


CapaJC
ServiceNow Employee
ServiceNow Employee

Sounds like you're not getting the revised UI Script, since I don't see any way you can get that message going through that IF statement with the condition "false" like that.

If you add an alert inside the same IF statement, do you get the alert as well?


Hi CapaJC,


I have the same problem- even commenting out the error lines in the script, I still get the "Record must be saved first" error.   Did you find a solution to this issue?   Thank you!