Activity Forums Salesforce® Discussions Why do we use $A.enqueueAction(action) in Salesforce?

  • shariq

    Member
    September 23, 2018 at 11:13 pm

    It adds the server-side controller action to the queue of actions to be executed. Rather than sending a separate request for each individual action, the framework processes the event chain and batches the actions in the queue into one request. The actions are asynchronous and have callbacks

  • Parul

    Member
    September 23, 2018 at 11:48 pm

    $A.enqueueAction(action) sends the request the server. More precisely, it adds the call to the queue of asynchronous server calls. That queue is an optimization feature of Lightning.

    ({
    doInit : function(component, event) {
        var action = component.get("c.findAll");
        action.setCallback(this, function(a) {
            component.set("v.contacts", a.getReturnValue());
        });
        $A.enqueueAction(action);
    }
    })

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Free 5 Day Salesforce Challenge!

Video in

To access the signup form head over to www.talentstacker.com/Salesforce TalentStacker Podcast Salesforce Episode: https://talentstacker.libsyn.com/how-to-earn-60k-100k-a-year-within-6-months-without-a-college-degree-say-what-salesforce-career-development-path-with-bradley-rice Do you already have a job as a Salesforce Professional and…