You need to sign in to do that
Don't have an account?
Javascript button error: Attribute was already specified for element "update"
Hello,
I had a simple javascript button that worked fine for months. It now suddenly doesn't work. I have seen something about protoype causing this error but as far as I'm aware I haven't done anything with prototype and haven't added any new functionality in a while. any idea why we might be getting this error?
Button:
{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}
var conRecord = new sforce.SObject("Contract");
conRecord.id = "{!Contract.Id}";
if ('{!$Profile.Name}'=='System Administrator'||'{!$Profile.Name}'=='Legal Admin'||'{!$Profile.Name}'=='Contract Manager'){
conRecord.Status = "Cancelled";
conRecord.Name = "CANCELLED - " + '{!Contract.Name}';
}
else {
conRecord.Status = '{!Contract.Status}';
conRecord.Name = '{!Contract.Name}'
}
var result = sforce.connection.update([conRecord]);
if (result[0].getBoolean("success"))
{
// Refresh window
window.location.reload();
}
else
{
alert("You do not have permission to cancel this contract");
}
Here's the complete error I'm getting:
faultcode:'soapenv:Client', faultstring:'Attribute "xmlns" bound to namespaces "http://www.w3.org/2000/xmlns/" was already specified for element "update"'
Thanks in advance!
-Hassab
See what happens if you change
{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}
to
{!REQUIRESCRIPT("/soap/ajax/21.0/connection.js")}