You need to sign in to do that
Don't have an account?
Carolyn juliana 7
getting Illegal conversion from List<AggregateResult> to List<String>
Hi,
I am tryin gto fetch a field value and below is the code,but i am getting below error in SForce
here is apex code
I am tryin gto fetch a field value and below is the code,but i am getting below error in SForce
Illegal conversion from List<AggregateResult> to List<String>
here is apex code
public class PickListHandler { @AuraEnabled public static List<String> getLevel1(){ List<AggregateResult> groupedLevel1 = [select Level_1__c,COUNT(id) from Case_Type_Data__c group by Level_1__c]; for(AggregateResult ar : groupedLevel1){ System.debug('Level Value Is' + ar.get('Level_1__c')); } return groupedLevel1; } }
Either change the method to pass back a List<AggregateResult> or modify the method to convert the AggregateResult to a List of Strings.
Note, if you pass back the List<AggregateResult> , you will need to handle it as such in the code that is invoking this method.
Regards
Andrew
All Answers
Either change the method to pass back a List<AggregateResult> or modify the method to convert the AggregateResult to a List of Strings.
Note, if you pass back the List<AggregateResult> , you will need to handle it as such in the code that is invoking this method.
Regards
Andrew
Your return type of the method is So you can try::