Javascript Remoting for APEX controller

Javascript remoting is the process that provides support for some methods in APEX controllers to be called via Javascript.The @RemoteAction annotation is currently available as a Developer preview.You have to contact support to enable this feature.To use Javascript remoting, your request must take the following form:
[<namespace>.]<controller>.<method>([params...,] <callbackFunction>(result, event)
// callback function logic
}, {escape:true});
  • namespace is your organization's namespace. This is only required if the class comes from an installed packaged.
  • controller is the name of your Apex controller
  • method is the name of the Apex method you're calling
  • params is the comma–separated list of parameters that your method takes
  • callbackFunction is the name of the function that handles the response from the controller. It returns the status of the call and the method result.
  • escape defines whether your response should be escaped (by default, true) or not (false)
In controller, your Apex method declaration is preceded with the @RemoteAction annotation like this:

global static String getItemId(String objectName) { ... }
Example code:

/*VF page*/

<script type="text/javascript">
function updateStatus(input,id) {
var inputStatus=id;
document.getElementById(id).value="Short Listed";
/*@VF Component*/
<apex:selectCheckboxes onclick="updateStatus(this,'{!app.Name}');">
/*In Controller*/
global static Applicant__c doShortListThroughCheck(String para){
Applicant__c applicant;
applicant=[select Name, Name__c, Status__c from Applicant__c where Name =:para limit 1];
applicant.Status__c='Short Listed';
update applicant;

}catch(DMLException e){
return null;
return null;


  1. hI I AM NEW TO SALESFORCE. So could you please tell me about the visuval force,apex,governor limits

    1. Go to Developerforce sites, and make friendship with Google ....;)


Post a Comment

Popular posts from this blog

Displaying pop-up summaries on hover in visualforce

Do you want to be certified as a Salesforce Admin?

Unit Testing in Salesforce