How to resolve the error - mismatched integration value and iso code for field

During the state and country activation for my instance, some state fields were set to undefined value. I guess it could not be mapped with any state. Even when I go into that record and try to update with the right value, I keep getting this error message “Error: There's a problem with this state, even though it may appear correct. Please select a state from the list of valid states” I tried to create the below trigger to update this field but it is still not working. Please where have I gone wrong. Basically what I want is where billingstate is ‘undefined’ change to ‘Utah’

trigger novalue on Account(before update){    
    for(Account acc : trigger.new){
        if(acc.Billingstate == 'Undefined Value'){
            acc.Billingstate='Utah';
        }    
    }
}
Answered by Darsh K
To resolve the error - mismatched integration value and iso code for field:

You need to go through the below points to come out of your problem:-

Importing new or performing updates to existing records may result in data validation errors when State and Country picklists (S&CP) are enabled if the address data contained in your file does not match the predefined state and country data

Users may encounter the following errors which are related to performing a data manipulation operation (an import, insert, update, or upset) when state and country picklists are enabled:

There's a problem with this state, even though it may appear correct. Please select a state from the list of valid states.: [Billing / Shipping] State/Province

Cause:-

This error is known to occur when mapping to standard State and Country fields (Billing/Shipping State & Billing/Shipping Country) and for records in your import file that do not have a correct or corresponding state or country value. It may be incorrect due to the state not existing for the country specified or the values for either field not matching the Integration Value set in S&CPL's setup.

if the state value is confirmed as correct and the record does not share the default country selected in S&CPL setup, the error may occur when users have mapped State fields without mapping country fields.

Additional considerations and behaviours:
Mapping CountryCode with standard State field is successful
Mapping CountryCode with StateCode is successful

Mapping StateCode with standard Country fields fails if your file's State values country is not set as the default country.

Mapping the standard State field without the standard Country field fails if the state belongs to a country outside of the states listed in the default country set in S&CPL setup.

State and Country picklist labels do not show in Salesforce1 when editing and creating records.

Note:-

If integration values are the same as the ISO code values or differ from the State/Country full names it is a clear indication that they have been updated either through user interface via setup or potentially through the Metadata API prior to enabling the feature. Disabling and re-enabling the feature will not change the state/country integration values. Support does not have the ability to reset integration values back to default or track who and when changes were made to the state and country picklist's setup.

Best practices and considerations to avoid receiving the above errors on import when using S&CP:

Set the default country to --None-- in your state and country picklist's setup section. This is not required but will help to ensure that a default country selection is not influencing the outcome of your data operation. See Configuring State and Country Picklists for more details on setting a default country. Map both Standard State and Country fields together (BillingState, ShippingState & BillingCountry, ShippingCountry) OR both the StateCode and CountryCode fields together (BillingStateCode, ShippingStateCode & BillingCountryCode, ShippingCountryCode). For example, if you're mapping ShippingCountry it is recommended that you also map ShippingState and in contrast, if you're mapping ShippingCountryCode it's recommended that you map the ShippingStateCode field as well. An import which has standard fields (BillingCountry, ShippingCountry) mapped in conjunction with address code (ISO) fields (ShippingStateCode, BillingStateCode) may result in an error.



Your Answer

Interviews

Parent Categories