Is it possible to pass a JavaScript object to Apex controller in lightning?
Here is what I tried:
@AuraEnabled
public static void changeProgram(Object info) {
update new zced__Training_Program__c(
Id = info.Id
);
}
I am getting the error:
Variable does not exist: Id
I believe I am getting this because Object
in Apex and object in JavaScript are different things.
So, I found that there is such a thing called JavaScript Map and there are a lot of examples how to pass it from client-side controller to server-side. And I am feeling it can easily substitute the JavaScript object, but still I would like to know for sure whether or not it is possible.
I am only interested in the Apex part.