I have created a method where I need to show child records of parent record , when i run the query on developer console it gives the result but the same result doesnot show on the page. below are the code :-
@AuraEnabled
public static List<childobj> getWL(id Woid) {
return new List<childobj> ([SELECT Id,LineItemNumber, Training_Completed__c,
AssetId,Billing_Type__c,Customer_Local_Start_Time__c,Customer_Local_End_Time__c ,Duration,On_Job_Training__c,Optional_STB__c,SAP_Billable__c
FROM childobj Where parentobjid = :Woid]);
}
Not sure what i am missing here .If anyone has alternative solutions please provide.
2 answers
Hi Shubham Sinha, Need to pass the parameters from your lightning component controller to apex controller for example:
var action = cmp.get("c.getWL");
action.setParams({ Woid: cmp.get("v.RecordID") });
Reference:
https://developer.salesforce.com/forums/?id=9060G000000I5cdQAC
https://blog.texei.com/lightning-components-auraenabled-method-parameters-whats-working-and-what-s-not-83c351356104
http://theblogreaders.com/passing-parameters-lightning-component-controller-controller-component/
Thanks & Regards,
Sakthivel Madesh