0

I already had a working apex function with various string parameters that I pass via the JS helper. I just added a new String parameter "reasonPick" to the apex function however when I try to pass in this new value via setParams, the parameter is always null when I debug it in Apex. I checked and the variable I attempt to pass is not null inside the helper and is type String. I also was able to pass the variable using one of the older parameters and I am able to see the correct value. I just can't seem to add any new parameters without them being null after being passed to Apex. I set the reasonPick variable somewhere above. Just a string value. I was able to pass reasonPick using reasonId but not using reasonPick.

var saveEventAction = component.get("c.saveEvent");
    console.log(reasonPick);
    saveEventAction.setParams(
        {
            reasonId: reasonId,
            dispatchAlert: dispatchAlert,
            reasonPick: reasonPick
            testVar: "Test"
        }
    );

public static Event saveEvent(String reasonId, String dispatchAlert,
    String reasonPick, String testVar)
{
    System.debug(reasonPick);
    System.debug(testVar);

These aren't all the parameters but they others are all passed in correctly. Only reasonPick and testVar are unable to be passed.

2
  • add your code so everyone can help you. – anxiousAvocado May 4 at 14:24
  • I added in portions of my code hopefully this will help others identify the issue. – Franky May 4 at 14:39

Your Answer

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

Browse other questions tagged or ask your own question.