Answers for "unexpected token list picklistcontroller"

0

unexpected token list picklistcontroller

public class PickListController {
	@AuraEnabled        
  public static List<String> getPickListValuesIntoList(String objectType, String selectedField){
      List<String> pickListValuesList = new List<String>();
      Schema.SObjectType convertToObj = Schema.getGlobalDescribe().get(objectType);
      Schema.DescribeSObjectResult res = convertToObj.getDescribe();
      Schema.DescribeFieldResult fieldResult = res.fields.getMap().get(selectedField).getDescribe();
      List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
      for( Schema.PicklistEntry pickListVal : ple){
          pickListValuesList.add(pickListVal.getLabel());
      }     
      return pickListValuesList;	
  }

}
Posted by: Guest on May-26-2021

Code answers related to "unexpected token list picklistcontroller"

Browse Popular Code Answers by Language