Dynamics CRM 2011 How To
A field is accessed via the
var field = Xrm.Page.getAttribute("fieldname");
Then to get the value of the field:
var value = field.getValue();
to set the value of the field:
These are normally done on a single line rather than broken down into steps, i.e.:
var oldValue = Xrm.Page.getAttribute("someField").getValue();
You might also find the following notes useful:
These notes have been tested with Microsoft Dynamics CRM 2011, and may apply to other versions as well.
About the author: Brian Cryer is a dedicated software developer and webmaster. For his day job he develops websites and desktop applications as well as providing IT services. He moonlights as a technical author and consultant.