Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

setCallback()

Sets the callback function that is executed after an Apex action returns.

Signature

setCallback (Object scope, function callback, String name)

Parameters

scope
Type: Object
The scope in which the function is executed. Always set this parameter to the keyword this.
callback
Type: function
The callback to invoke after the Apex action returns.
name
Type: String
Defaults to "ALL" which registers callbacks for the "SUCCESS", "ERROR", and "INCOMPLETE" states.