在crm中更新数据时属性值类型System.String不正确

时间:2018-06-29 10:41:22

标签: c#

  string result = "";
        string outputDecimal = AmountTobePaid.ToString("#,##0.00");
        try
        {
            Entity leadCourse = new Entity("pet_leadinterestedcourse");
            leadCourse.Attributes["pet_paymentstatus"] = new optionSetValue(6);
            leadCourse.Attributes["pet_amountpaid"] = outputDecimal;
            leadCourse.Id = new Guid(id);
            proxy.Update(leadCourse);
            result = "true";
        }

我遇到错误,CRM中的值未更新

1 个答案:

答案 0 :(得分:0)

leadCourse.Attributes["pet_amountpaid"] = new Money(AmountTobePaid);

*使用新关键字进行适当的协作*