I use the following code in order to retrieve the list of configured states in the org.
private static List<String> getStateList()
{
List<String> stateList = new List<String>();
Schema.DescribeFieldResult fieldResult = User.statecode.getDescribe();
List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
for( Schema.PicklistEntry f : ple){
stateList.add(f.getLabel());
}
return stateList;
}
However, when trying to deploy the code, I run into the following error: Variable does not exist: User.statecode
Can anyone shed some light on this issue - I am unable to deploy without this error being fixed.