When we sync a new Prospect to a Salesforce Lead, we get

Field Integrity Exception: 
A country/territory must be specified before specifying a state value for field: State/Province

Now when we inspect the Prospect, we indeed see that the State contains an invalid value "Not applicable".

So I created a "Before Insert" Trigger in Salesforce that sets the State field to Null if it is invalid. The Trigger works, and if we sync the Prospect to Salesforce I see in the debugging that the State and StateCode fields are Nullified in the Before Trigger.

All in all, the Salesforce logging shows no error. After we nullify the State field, the Lead looks fine.

However, we still get the same error message in Pardot, and consequently the Lead is not inserted into Salesforce. Any clue? What can I investigate?


Nevermind, I found it. It's a Salesforce bug :-(


As the bug title states: "State and Country picklist validation is still enforced even when a before trigger changes to a correct value". That is exactly what I am encountering here.

Let's remain positive, but that might take a few years to solve.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.