You need to sign in to do that
Don't have an account?
Cuerdas
Variable does not exist... what is happening?
This is my code;
public with sharing class HandlerNavi {
@AuraEnabled (cacheable = true)
public static List<Evento__c> getEvento() {
List<Evento__c> even = new List<Evento__c>();
for(Evento__c event :[SELECT Id, Name, Fecha__c FROM Evento__c ORDER BY Fecha__c]){
if(event.Fecha__c >= Date.today()){
listEventos.add(event);
}
}
return listEventos;
}
}
What is happening?
force-app\main\default\classes\HandlerNavi.cls Variable does not exist: listEventos (8:25)
force-app\main\default\classes\HandlerNavi.cls Variable does not exist: listEventos (11:24)
public with sharing class HandlerNavi {
@AuraEnabled (cacheable = true)
public static List<Evento__c> getEvento() {
List<Evento__c> even = new List<Evento__c>();
for(Evento__c event :[SELECT Id, Name, Fecha__c FROM Evento__c ORDER BY Fecha__c]){
if(event.Fecha__c >= Date.today()){
listEventos.add(event);
}
}
return listEventos;
}
}
What is happening?
force-app\main\default\classes\HandlerNavi.cls Variable does not exist: listEventos (8:25)
force-app\main\default\classes\HandlerNavi.cls Variable does not exist: listEventos (11:24)
You have declared the list variable as even and you were trying to add values to listEventos. you need to add values to even.
try with below. If this helps, please mark it as best answer.
THanks!!
All Answers
You have declared the list variable as even and you were trying to add values to listEventos. you need to add values to even.
try with below. If this helps, please mark it as best answer.
THanks!!