User-Defined Callback Function
You can use a callback function to handle responses to CRUD operations, as shown in the following.
Method Name | Description | Sample Code |
---|---|---|
Callback function name |
callback (request, response) User-defined JavaScript function to process the results of the CRUD operations. |
|
The parameters for a callback function are as follows:
request. The request object containing the command, row ID, and other field objects passed in the initial request.
response. The response object containing the result of the CRUD operation. The object properties are as follows:
status. The status of the request, which is either OK or ERROR.
data. The name-value pair of the fields whose values are returned (fieldNameValuePairs). For example:
Name="Account Test"
,Location="Account Location"
,Type="Competitor"
-
errors. Any error returned, which can be null or an error object.
helper function. The name of a helper function, for example,
getRowId()
,getModId()
. For more information, see Helper Functions for Callback Functions.