0

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?

1

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

https://success.salesforce.com/issues_view?id=a1p30000000T4OMAA0

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.

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.