Skip to content
Notifications
Clear all

Troubleshooting: Salesforce sync failing on opportunity updates.

4 Posts
3 Users
0 Reactions
27 Views
(@aidenh5)
Reputable Member
Joined: 3 months ago
Posts: 312
Topic starter   [#14389]

Seeing failures when a Salesforce opportunity is updated. Sync stops, error log just says "validation error" from Salesforce side.

We're syncing to a custom object. Here's the mapping:

* Amount → Custom_Amount__c
* CloseDate → Custom_Close_Date__c
* StageName → Custom_Stage__c (picklist-to-picklist)

Checked the obvious:
* API user has modify all on both objects.
* Field-level security is open.
* Picklist values match exactly.

The error only happens on updates, creates work fine. Suspect it's sending a blank or invalid field during the update payload that Salesforce rejects. How are you handling partial updates? Do we need to explicitly map every single field, even if unchanged?


Ship fast, review slower


   
Quote
(@carlr)
Reputable Member
Joined: 3 months ago
Posts: 407
 

Your suspicion about partial updates is likely correct. The sync tool probably sends the entire mapped record, not just changed fields. If your source system has nulls for unmapped fields, you're implicitly trying to write those nulls to the Salesforce record, which will fail for any non-nullable custom field.

Enable debug logging on the sync or use a proxy to capture the exact outgoing PATCH payload. You'll see the problem. You either need to:
* Configure the sync to only send changed fields.
* Ensure your mapping includes every required field on the custom object, even if you just set a static default.


Your fancy demo doesn't scale.


   
ReplyQuote
(@clara12)
Estimable Member
Joined: 3 months ago
Posts: 210
 

That's a really interesting observation about partial updates. It makes me wonder if the error is specifically related to the picklist field.

If the sync is sending the entire mapped record for an update, what happens if the picklist translation fails? For example, if your source system's "StageName" field is empty on a particular record, could the sync be trying to write a blank string to the `Custom_Stage__c` picklist? Even if creates work, maybe the initial data set had no nulls, but updates are hitting records where that field is legitimately empty.

Have you checked the audit trail for one of the failed updates to see what the actual value being sent was at the moment of the sync?



   
ReplyQuote
(@carlr)
Reputable Member
Joined: 3 months ago
Posts: 407
 

Picklist nulls are absolutely a common culprit, but the validation error is probably more explicit than you'd think. It's not just about sending a blank string, it's about sending a value *not in the picklist*. A blank string is technically not a valid picklist value unless you've explicitly added it.

The real issue, following user810's point, is that a full-record payload for an update will include *every* mapped field. If `StageName` is mapped but happens to be null in that particular update's source data, the sync will send `Custom_Stage__c: null`. Salesforce will reject that as an invalid picklist value, full stop. The audit trail will show the field being set to `null`, not an empty string.

This is why you capture the exact payload. Guessing at the picklist translation is a waste of time when you can see the raw JSON Salesforce received.


Your fancy demo doesn't scale.


   
ReplyQuote