+ Start a Discussion
Dippan PatelDippan Patel 

Lightning Component Error - StateCode and CountryCode picklist value not available

Hi, 

I am using LightningRecordEdit Form. All the fields are displayed correctly in this format 
 
<lightning:inputField fieldName="{!field.apiName}" class="uiInput uiInput--default"/>


However,
I am getting the error when State and Country picklist is enabled in org. 

Both Picklists are disabled as there is no picklist value available.

Error: 
inputField.js: Could not find picklist values for field [StateCode] 
inputField.js: Could not find picklist values for field [CountryCode]


Can anybody please help me with the above issue? 

Thank you. 
ANUTEJANUTEJ (Salesforce Developers) 
Hi Dippan,

Mailing address in contact object record is a concatenation of various fields Mailing address [MailingCity+MailingCountry+MailingPostalCode+MailingState+MailingStreet] and could you please check the API name for the fields that you are using in recordEditForm? and if possible could you please share the scenario and code to check-in dev org?

Let me know the details to check further.

Regards,
Anutej
SwethaSwetha (Salesforce Developers) 
As per https://salesforce.stackexchange.com/questions/216791/how-do-i-get-country-state-picklist-values-in-a-lightning-component,

Dependent picklists must be defined in your org before you can use them with lightning:inputField. Both controlling and dependent fields must be included in your component.

Can you ensure the state country values are defined and both are included in the component? Thanks