function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dipu2dipu2 

Is it possible to reference diferent controllers for Remote Actions in one VF page?

I have remote actions in two different controllers. Is it possible to  invoke remote actions from two different controllers from single VF page?

 

 

Best Answer chosen by Admin (Salesforce Developers) 
GullGull

You can call one function and pass parameter and then on server side using variables decide from which controller you want to call function. Call function and return value.

 

Or you can use multiple extensions and then call function from one extension based on parameters.

All Answers

GullGull

You can call one function and pass parameter and then on server side using variables decide from which controller you want to call function. Call function and return value.

 

Or you can use multiple extensions and then call function from one extension based on parameters.

This was selected as the best answer
dipu2dipu2

Thanks for the response.

My requirement is little more complex. I have about six controllers and the result of remote action has to be processed by JavaScript. My primary goal was to reduce the repeatiton of the remote function as well as JavaScript code by passing the controller name to a JavaScript function. So I had to do what you had suggested. All of the controller has the same remote functon which call a function from another class.

I just had to write processRemoteAction(RemoteController) JavaScript function that takes any controller as parameter as long as the controller has the remote function used inside the JavaScript function.