I created this javascript to auto populate a field, with values from other fields. It is called in the form onSave event.
function OppTopic() {
var products = "";
var parent = Xrm.Page.getAttribute("parentaccountid").getvalue();
var city = Xrm.Page.getAttribute("address1_city").getValue();
var automation = Xrm.Page.getAttribute("new_automationfeatures").getValue();
var service = Xrm.Page.getAttribute("new_service").getValue();
//Determines if a Product/Service is selected
if (automation == true) {//***AUTOMATION***
if (products != ""){
products += ",Automation";
}
else{
products = "Automation";
}
}
if (service == true) {//***SERVICE***
if (products != "")
products += ",Service";
else
products = "Service";
}
if (automation == false && service == false) {
products = "null";
}
var subject = parent + " - " + city + " - " + products;
Xrm.Page.getAttribute("name").setValue(subject);
}
But , when the form is saved this is the error that appears.I'm not really sure what the error means?
I have checked the field names and they are correct. What could be the problem that is causing this error?
Thanks