Question Status

Unanswered
Dilip Gawas asked a question on 17 Mar 2015 11:25 PM

Hi,

I have a field in opportunity of type currency. When I put decimal data in that field I am able to create opportunity but when I am trying to update with same data it is giving error of casting.

Do I need to convert decimal data to currency type. if yes can anyone has idea to convert decimal to currency in c#.

Thanks,

Dilip

Reply
Dilip Gawas responded on 17 Mar 2015 11:32 PM

I got the answer,

myEntity.Attributes["abc_transactionamount"] = new Money((decimal)obj.TotalAmountToPay);

Thanks,

Dilip

Reply
mscrmba responded on 26 Mar 2015 5:59 PM

I'm not sure that you should need to covert the type.

If you do maybe you could use:

string.Format("{0:C}",decimalvalue );

Reply