How can you call a controller method from javascript?
Answer / Prakash Narayan Mishra
To call a controller method from JavaScript in Salesforce, use the $A.getCallback() function along with $A.enqueueAction(). Here's an example:n```javascriptn$A.getCallback(function(){{n var action = $A.createAction(actionType);n action.setParams({param1: 'value1'});n $A.enqueueAction(action).then(function(response) {n // Handle response from controller method here.n });n}});n```
| Is This Answer Correct ? | 0 Yes | 0 No |
What type of workflow alerts are there?
What is the difference between the normal “insert” operation and “database.insert” operation ? Which is preferred over the other and why ?
What is transient keyword in salesforce?
Can a dependent field be a controlling field as well in salesforce ?
How can you create object relations in salesforce?
How many records can we fetch using one soql query?
What is an Auto-Response Rule?
If a user does not have access to a specific record type, will they be able to see the records that have that record type? : salesforce sharing and security
What is lazy loading in salesforce?
Explain what is Audit trail?
What is manual sharing?
Compare Jump Start Wizard vs. Standard Wizard?