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
VijayNiVijayNi 

Unexpected Token - List

Hi Team,

I am doing a traihead challenege of aura component to override standard action but in the apex class i am facing the below error in dynamic apex can you help me out .

Apexcontroller 

@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; }
 
ANUTEJANUTEJ (Salesforce Developers) 
Hi Vijay,

Please make sure you are using an appropriate data type that is supported.

Going forward for all the Certification and Trailhead Guidance please report it here,

https://trailhead.salesforce.com/en/help?support=home

https://trailhead.salesforce.com/help

So that our trailhead support engineers will look into it and get back to you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Regards,
Salesforce Support.