Salesforce System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, There’s a problem with this state, even though it may appear correct. Please select a state from the list of valid states.:

Salesforce System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, There’s a problem with this state, even though it may appear correct. Please select a state from the list of valid states.:

Exception:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, There’s a problem with this state, even though it may appear correct. Please select a state from the list of valid states.:

Resolution:

Use the full country name instead of the Country code.

Code which causes the error:

Account objAcc = new Account();
objAcc.Name = 'Testing Account';
objAcc.BillingCountry = 'United States';
objAcc.BillingState = 'WA';
objAcc.BillingPostalCode = '54321';
insert objAcc;

State should not have abbreviation. Use Washington to resolve the issue.

Leave a Reply