Return to Snippet

Revision: 43538
at March 26, 2011 00:38 by abhinavguptas


Initial Code
public global with sharing class  testremotingcontroller {
 @RemoteAction
 global static Account[] searchAccounts(String accountName) {
    // Search accounts for the account name passed from Javascript
    accountName = accountName.replaceAll('[*]', '%');
    return [select id, name, phone, type, numberofemployees from 
             Account where name like :accountName ];
  }   
    
 @RemoteAction
 global static boolean updateAccount(String accountId, String phoneNum) {
   // update account for the accountId and phone-number passed from Javascript
   update new Account(Id = accountId, Phone = phoneNum);      
   return true;
 }
}

Initial URL
http://snipplr.com/view/51124/editable-account-grid-using-visualforce-javascript-remoting--jquery-templates/

Initial Description
The matching visualforce page code can be found here : http://snipplr.com/view/51124/editable-account-grid-using-visualforce-javascript-remoting--jquery-templates/

Initial Title
Apex Controller for Javascript Remoting Sample

Initial Tags

                                

Initial Language
Java