I noticed a peculiar scenario today in which currency field value on CRM forms were not accessible using 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);
Hope it helps!
![]() |
Check this out |
Trying to Learn Dynamics CRM: Download!
Learn Dynamics CRM App on Google Play store
Thank you for the post. When populating a Currency field in a CRM form, is there another attribute you have to set besides the .setValue?
No there ain’t another attribute t set
i need to get in one entity and set another entity fields.
how to do
You can do so in plugins or you need to use odata/soap calls from your javascript.
how this can work for crm 2013-??????
Hi Carlos,
I have used this script during CRM 2013 Rollup 1 and it used to work.
Regards,
Deepesh
[…] For JS reference refer my older blog post: Click here […]
hello and thank you for the information,
I am having the same problem but in Xml (or fetch xml ?) in CRM,
I am extracting some information using a webgrid in asp.net that connects to CRM,
all fields work fine, except the money field which instead of displaying the value, it displays: Microsoft.Xrm.Sdk.Money …. I al using a sitesetting with the entity “incident”
I tried .Value and lot of stuffs but nothing works so far, do you have an idea ?
Thanks in advance.
Hi Mehdi,
Please try to typecast money field using sdk classes and fetch just the value.
Hello
This is my code inside a webgrid, how can I do the modifications you told me ?
Thanks 🙂
Hi Mehdi, The code cannot be pasted in comments, wordpress.com does not allow it.You can mail me on deepeshsomani@hotmail.com
hello, ok, I sent you an E-mail 🙂
[…] Get/Set currency field values in JavaScript for Dynamics CRM […]