You need to sign in to do that
Don't have an account?
Abhishek Sharma 527
passing Date to Backend
Hello Experts, I have Apex class where I'm running query under a method and this goes to JS page but I don't know how to pass the data back to Apex.
Please Suggest !
@AuraEnabled //dynamic filter public static List<queryWrap> DynamicFilter(String startDate, String endDate, String Provider){ String status1 = 'Non-Billable'; String evtQuery = 'Select Id, Start_Date_Time__c, EndDateTimeV3__c, Additional_Provider_Name__c, Subject from Event where Appointment_status__c = :status1'; if(!String.isBlank(startDate)){ Datetime stDate = date.parse(startDate); evtQuery = evtQuery + ' AND Start_Date_Time__c =: startDate'; } if(!String.isBlank(endDate)){ Datetime enDate = date.parse(endDate); evtQuery = evtQuery + ' AND EndDateTimeV3__c =: endDate'; } if(!String.isBlank(Provider)){ evtQuery = evtQuery + ' AND Additional_Provider_Name__c =:Provider'; }
Please Suggest !
To pass data from a JS page back to Apex, you can use a server-side action method in your Apex class and call that method from your JS controller using an Apex method in the lightning framework.
Please review this documentation for your ask -> https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_actions_call.htm
Hope it helps !
Thank you.