Activity Forums Salesforce® Discussions What is a Javascript remoting for apex controllers in Salesforce? Explain its parts.

  • Anjali

    Member
    August 17, 2018 at 1:01 pm

    Hi Madhulika

    JavaScript remoting is a tool that front-end developers can use to make an AJAX request from a Visualforce page directly to an Apex controller. JavaScript remoting allows you to run asynchronous actions by decoupling the page from the controller and to perform tasks on the page without having to reload the entire page.

    JavaScript remoting has three parts:

    • The remote method invocation you add to the Visualforce page, written in JavaScript.
    • The remote method definition in your Apex controller class. This method definition is written in Apex, but there are few differences from normal action methods.
    • The response handler callback function you add to or include in your Visualforce page, written in JavaScript.
  • shariq

    Member
    September 17, 2018 at 11:04 pm

    Hi,

    Use JavaScript remoting in Visualforce to call methods in Apex controllers from JavaScript. Create pages with complex, dynamic behavior that isn’t possible with the standard Visualforce AJAX components.
    Features implemented using JavaScript remoting require three elements:The remote method invocation you add to the Visualforce page, written in JavaScript.
    The remote method definition in your Apex controller class. This method definition is written in Apex, but there are some important differences from normal action methods.
    The response handler callback function you add to or include in your Visualforce page, written in JavaScript

     

    Hope this helps.

  • Parul

    Member
    September 21, 2018 at 2:05 pm

    hi

    JavaScript remoting is a tool that front-end developers can use to make an AJAX request from a Visualforce page directly to an Apex controller. JavaScript remoting allows you to run asynchronous actions by decoupling the page from the controller and to perform tasks on the page without having to reload the entire page.

    @RemoteAction
    global static Account getAccount(String accountName)
    {
    account = [select id, name, phone, type, numberofemployees from Account where name = :accountName ];
    return account;
    }
    }

     

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos