Return to Snippet

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

Initial Code
public global with sharing class  testremotingcontroller {
 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 ];
 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

Initial Description
The matching visualforce page code can be found here :

Initial Title
Apex Controller for Javascript Remoting Sample

Initial Tags

Initial Language