HI,
I'm new to programming in CRM and I'm trying to write a simple javascript that will take the first and last name of a lead and populate the company name field. Currently I only have the the OnChange event triggering on the last name. When I change the last name I receive the above error. Here is my code....
function updateCompanyName() { var newCompanyName; var firstName; var lastName; firstName = Xrm.Page.getAttribute("firstname").getValue() lastName = Xrm.Page.getAttribute("lastname").getValue(); newCompanyName = firstName + " " + lastName; Xrm.Page.getAttribute("companyname").setAttribute(newCompanyName); alert(newCompanyName); }
Thank you for the help!!
Gary