Showing posts with label get the currency field. Show all posts
Showing posts with label get the currency field. Show all posts

Monday, November 3, 2014

Get/Set currency field values in JavaScript for Dynamics CRM

We Cannot use the below code to retrieve the currency field value
Xrm.Page.getAttribute(“Currency field name”).getValue() and Xrm.Page.getAttribute(“Currency field name”).setValue(Value)

The resolution is in such cases you can access currency fields in below manner:
// To get currency field
Xrm.Page.data.entity.attributes.get(“Currency field name”).getValue();
// To set currency field

Xrm.Page.data.entity.attributes.get(“Currency field name”).setValue(Value);