Saturday, December 1, 2018

What is Remote Action in Salesforce?

In this blog, we will learn how to use Remote Actions in Visualforce Page.

But what is a Remote Action? 


Remote Action is a way to access Apex method using Javascript in your Visualforce page.
It allows you to create pages with complex, dynamic behavior that isn’t possible with the standard Visualforce AJAX components.

Remote action method should always have the @RemoteAction annotation and it should be Static.

Let's take an example where we need to retrieve the first five Cases with Status to New.



Output:

Point to remember:

  • @RemoteAction annotation is mandatory
  • Remote Action methods should always be static
  • If you are using the Visualforce Page inline in a Page Layout, then the method should be declared as global instead of public

2 comments:

  1. The article provides a clear introduction to Salesforce Remote Actions and shows how an Apex method annotated with @RemoteAction can be invoked directly from JavaScript in a Visualforce page. The example using case priority demonstrates how dynamic data can be retrieved and rendered on the page without relying on standard Visualforce AJAX components.

    The JavaScript and Apex integration demonstrated here can be explored further through a Javascript Online Course in India, particularly for understanding JavaScript functions, callbacks, and dynamic DOM updates.

    ReplyDelete
  2. The practical use of JavaScript to invoke server-side functionality also provides useful context for Javascript Online Training in India, where developers can build more interactive and dynamic web application interfaces.

    ReplyDelete