简体   繁体   English

使用BigDecimal时Salesforce update()方法错误

[英]Salesforce update() method error when using a BigDecimal

Is there a different between the upsert and update operations in Salesforce when it comes to data types? 关于数据类型,Salesforce中的upsert和update操作之间有区别吗?

I use upsert to sync up my Contacts and update to sync up my Accounts. 我使用upsert同步我的联系人并更新以同步我的帐户。

When setting a custom field for a contact I pass it a BigDecimal value, and it happily syncs with Salesforce, do the same for my Account when I call update and I get: 在为联系人设置自定义字段时,我将其传递给BigDecimal值,并愉快地与Salesforce同步,当我致电update并得到以下信息时,请对我的客户执行相同的操作:

Unable to find xml type for :java.math.BigDecimal 无法找到:java.math.BigDecimal的xml类型

Seems that the update method doesn't like BigDecimals? 似乎更新方法不喜欢BigDecimals?

Thanks, 谢谢,

Chris 克里斯

I can't say why exactly you'd be getting that problem with Account and not Contact, but my first inclination would be not to try to pass in a BigDecimal at all and instead convert it to a double first using BigDecimal.doubleValue(). 我无法说清楚您为什么会用Account而不是Contact遇到问题,但是我的第一个倾向是根本不尝试传入BigDecimal,而是使用BigDecimal.doubleValue()将其首先转换为double。 。 The downside is that you may lose some precision there, but the upside is that it should work without incident :). 不利之处是您可能会在此失去一些精度,但不利之处在于它应该可以正常工作:)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM