2
votes

Is there a different between the upsert and update operations in Salesforce when it comes to data types?

I use upsert to sync up my Contacts and update to sync up my Accounts.

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:

Unable to find xml type for :java.math.BigDecimal

Seems that the update method doesn't like BigDecimals?

Thanks,

Chris

1

1 Answers

0
votes

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(). The downside is that you may lose some precision there, but the upside is that it should work without incident :).