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
Glen CubinarGlen Cubinar 

How can I retrieve parent country value from the OOB State and Country Picklists setup?

Hi Everyone,

I would like to retrieve the following details in the OOB State and Country Picklists.

-Parent Country
-State
-State Code
-Active

Im using the code:

Schema.DescribeFieldResult fieldResult = User.StateCode.getDescribe(); List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();

User-added image

the problem is i can only retieve the following values:

Schema.PicklistEntry[getLabel=Abu Dhabi;getValue=ABUDHABI;isActive=true;isDefaultValue=false;]

Parent Country is not included, how can i get the parent country for each specific state?

Thanks