I have created an array of list custom setting in JS controller of lightning component. When I call apex controller method and pass this array, inside controller its value comes as empty. However, when I pass a single record of the same custom setting, that value is accessed successfully and I can see all its field values.
I think that there is some way that I am unknown in Javascript where you can send an array of list custom setting to apex. Does anybody has idea about this?
My code of lightning component helper:
//"setting" is the list custom setting record passed as attribute in an event
//"updatedCustomSettingList" is the attribute in this component of type "list" used to fill everytime a record is sent to this component
createSettingList : function(component, event){
var setting=event.getParam("setting");
var updatedCustomSettingList = [];
updatedCustomSettingList=component.get("v.updatedCustomSettingList");
updatedCustomSettingList.push({
value : setting
});
component.set("v.updatedCustomSettingList", updatedCustomSettingList);
}
Component:
<aura:attribute name="updatedCustomSettingList" type="list" />
Apex controller method:
public static void updateEditedValues(List<TimeTrackerConfigSettings__c> settingList){
system.debug('inside method, setting returned is: '+ settingList); //value comes as {}