I want to pass a list of Orders from the JavaScript Controller into the Apex Controller. When I debug, I get a value for the list of orders in the JavaScript Controller, but the Apex Controller does not receive the parameter. Here is the code:

JavaScript Controller

shiftOrders : function(component, event, helper) {

    var selectedOrders = component.get("v.selectedOrders");
    var selectedOrdersString=JSON.stringify(selectedOrders);
    console.log("selectedOrdersString "+selectedOrdersString);

    var shiftOrders = component.get("c.shiftOrders"); 
        selectedOrdersString : selectedOrdersString
    shiftOrders.setCallback(this, function(responseOrders){
        console.log("responseOrders.getReturnValue() "+responseOrders.getReturnValue());


Apex Controller

public static String shiftOrders(String selectedOrdersString){

    system.debug(logginglevel.debug, 'selectedOrdersString'+selectedOrdersString);

    //List<Order> selectedOrders = (List<Order>)JSON.deserialize(selectedOrdersString, List<Order>.class);      

    return selectedOrdersString;


What is the problem?


I found the issue, the Apex method needs to be a getter Method: getShiftOrders!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.