Morning all
I'm trying to convert a money field to a decimal but i keep getting an error about unable to cast. I have tried it various ways with no joy. Any ideas
for (int index = 0; productPriceLevelList.Entities != null && index < productPriceLevelList.Entities.Count; index++)
{
Entity newProductPriceLevelEntity = new Entity("productpricelevel");
newProductPriceLevelEntity["pricelevelid"] = new EntityReference("pricelevel", newPriceLevel.Id);
newProductPriceLevelEntity["productid"] = productPriceLevelList.Entities[index]["productid"];
newProductPriceLevelEntity["productnumber"] = productPriceLevelList.Entities[index]["productnumber"];
newProductPriceLevelEntity["uomid"] = productPriceLevelList.Entities[index]["uomid"];
string prodidse = Convert.ToString(productPriceLevelList.Entities[index]["productnumber"]);
decimal currentvar = Convert.ToDecimal(productPriceLevelList.Entities[index]["amount"]);
Kind regards
Dan
*This post is locked for comments
I have the same question (0)