Synchronous and Asynchronous Calls with the AJAX Toolkit

AJAX Toolkit allows to issue synchronous or asynchronous calls. Asynchronous calls allow the client side process to continue, waiting for a call back from the server. To issue an asynchronous call, you must include an additional parameter with the API call, referred to as a callback function. Once the result is ready, the server invokes the callback method with the result.


Synchronous syntax:

sforce.connection.method("arg1","arg2", ...);
e.g:
sforce.connection.login("MyName@MyOrg.com","myPassword1");
 
Asynchronous syntax:

method("arg1","arg2", ..., callback_method);
For example:

var callback = {onSuccess: handleSuccess, onFailure: handleFailure};
function handleSuccess(result) {}
function handleFailure(error) {}
sforce.connection.query("Select name from Account", callback);

Field Dependency

A dependent relationship that causes the values in a picklist or multi-select picklist to be dynamically filtered based on the value selected by the user in another field.
  1.  • The field that drives filtering is called the "controlling field." Standard and custom checkboxes and picklists (Multi-select picklist not allowed) with at least one and less than 300 values can be controlling fields. 
  2.  • The field that has its values filtered is called the "dependent field." Custom picklists and multi-select picklists can be dependent fields. 

 

Counters