web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Cannot implicitly convert type 'decimal' to 'Microsoft.Xrm.Sdk.Money'

(0) ShareShare
ReportReport
Posted on by 467

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

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Can you please provide your code?

  • Suggested answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    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);

  • Inogic Profile Picture
    713 on at

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans