Notifications
Announcements
No record found.
Hi all,
In my CRM C# code I am getting following error
Cannot implicitly convert type 'decimal' to 'Microsoft.Xrm.Sdk.Money'
How to fix this. Thanks in Advance
Hello,
Can you please provide your code?
probably you are setting a currency field with just the decimal value, you will need to do something like this:
decimal newValue = 3.14m; updateRecord[new_moneyfield] = new Money(newValue);
Hi,
It seems that you are trying to set the value retrieve from the money field of Dynamics 365 CRM into a variable of type Money. Trying to do so will give an error "Cannot implicitly convert type 'decimal' to 'Microsoft.Xrm.Sdk.Money".
To solve this, rather than setting value in the Money type of variable kindly set the value of decimal type of variable as below:
decimal extendedAmount = product.GetAttributeValue<Money>("extendedamount").Value;
Hope this helps.
Thanks!
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 70 Super User 2025 Season 2
Gerardo RenterÃa Ga... 43 Most Valuable Professional
Daniyal Khaleel 32 Most Valuable Professional