You need to sign in to do that
Don't have an account?
Sergio Mac Intosh
How can i pass attributes when calling an apex class
I got this lightning method which calls the apex class 'getProducts'. Now i would like to call a apex class which needs an attribute.
How can i do this?
How can i do this?
getMyObjects: function(cmp){ var action = cmp.get("c.getProducts"); action.setCallback(this, function(response){ var state = response.getState(); if (state === "SUCCESS") { cmp.set("v.myObjects", response.getReturnValue()); } }); $A.enqueueAction(action); }
use action.setParams(); method for set attribute on apex class from component
go to below link for example
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_actions_call.htm
Mark it best answer if it helps you so it makr peroper solution for others in future :)
Thnaks