Sunday, 15 February 2015

dynamics crm 2011 - Crm Cast Is Not Valid -



dynamics crm 2011 - Crm Cast Is Not Valid -

there floating point number field name "new_poscost". existing value of field 0,00 or can decimal value. want sum value it. i'm getting cast error.

in first line of code poscost variable getting value of attribute. when comes assign sum of values entity's attribute, i'm getting "cast not valid" error.

decimal poscost = postentity.attributes.contains("new_poscost") ? (decimal)postentity["new_poscost"] : 0m; // value assigning poscost properly. flighthotel.entities[0].attributes["new_poscost"] = poscost+ (decimal)flighthotel.entities[0]["new_poscost"];

try utilize next approach:

double podnost = postentity.contains("new_poscost") ? new_poscost.getattributevalue<double>("new_poscost") : 0;

dynamics-crm-2011

No comments:

Post a Comment