• Cuerdas
  • NEWBIE
  • 10 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hello!

My question begins with a controller:
 
public with sharing class HandlerNavi {
   
        @AuraEnabled (cacheable = true)
            public static List<Evento__c> getEvento() {
                List<Evento__c> listEventos = 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;
            }
}

I want to show in Home (community cloud) a list of events availables order by date and not showing past events.

Clicking in an event must redirect to "Request Tickets" with preselected event. I found this tip on the internet https://suman1978.blogspot.com/2019/09/navigate-to-community-page-in-lwc.html but I need help.

Anyone can help me?
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)
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)