Quantcast
Channel: CRM Development Forum
Viewing all articles
Browse latest Browse all 888

Error: Object doesn't support property or method setAttribute

$
0
0

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


Viewing all articles
Browse latest Browse all 888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>