function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sfdc wonderSfdc wonder 

state and country enable

Hi,

can you give me any idea how to know State and country picklist values are enable or not in ORG through coding not UI.

i need to write validation on Address fields(country,state on Lead) in trigger.if it is text field my validations working fine.
But the org may be enable state and country picklist values its not working,i filled state and country picklist values also but it shows validations.

once state and country picklist values are enabled in ORG,the fields like Statecode and countrycode fields are appear.

we have to developed an app so i need to write my validation on both scenarios i.e,state and country enable or disable
can any one help us the best approach...

thanks



Best Answer chosen by Sfdc wonder
Ankit AroraAnkit Arora
Or probably you can describe on the object and check if fields like this are valid or not "BillingStateCode" etc.. Let me know if  that helps.

All Answers

Ankit AroraAnkit Arora
Not 100% sure, but don't think there is any option in code to identify this.
Ankit AroraAnkit Arora
Or probably you can describe on the object and check if fields like this are valid or not "BillingStateCode" etc.. Let me know if  that helps.
This was selected as the best answer