You need to sign in to do that
Don't have an account?
swain 10
Test Class For Lightning Controller?
public class OV_CountryList {
@AuraEnabled
public static List<String> getCountry(){
List<String> options = new List<String>();
Schema.DescribeFieldResult fieldResult = User.Countrycode.getDescribe();
List<Schema.PicklistEntry> plist = fieldResult.getPicklistValues();
System.debug('Picklist::'+plist);
for (Schema.PicklistEntry p: pList) {
System.debug(p.getLabel() +'::'+ p.getValue());
options.add(p.getLabel());
}
return options;
}
}
In this we are fetching picklist from global picklist
@AuraEnabled
public static List<String> getCountry(){
List<String> options = new List<String>();
Schema.DescribeFieldResult fieldResult = User.Countrycode.getDescribe();
List<Schema.PicklistEntry> plist = fieldResult.getPicklistValues();
System.debug('Picklist::'+plist);
for (Schema.PicklistEntry p: pList) {
System.debug(p.getLabel() +'::'+ p.getValue());
options.add(p.getLabel());
}
return options;
}
}
In this we are fetching picklist from global picklist
Steven Nsubuga
swain 10
Thanks a lot Steven
Steven Nsubuga
You're welcome!