RemoteObjectController
Namespace
Usage
RemoteObjectController is supported only for use within Remote Objects methods. See Overriding Default Remote Objects Operations in the Visualforce Developer’s Guide for examples of how to use RemoteObjectController with your Visualforce pages.
RemoteObjectController Methods
The following are methods for RemoteObjectController. All methods are static.
create(type, fields)
Signature
public static Map<String,Object> create(String type, Map<String,Object> fields)
Parameters
Return Value
Type: Map<String,Object>
The return value is a map that represents the result of the Remote Objects operation. What is returned depends on the results of the call.
- Success
- A map that contains a single element with the ID of the record created. For example, { id: 'recordId' }.
- Failure
- A map that contains a single element with the error message for the overall operation. For example, { error: 'errorMessage' }.
del(type, recordIds)
Signature
public static Map<String,Object> del(String type, List<String> recordIds)
Parameters
Return Value
Type: Map<String,Object>
- Single Delete—Success
- A map that contains a single element with the ID of the record that was deleted. For example, { id: 'recordId' }.
- Batch Delete—Success
- A map that contains a single element, an array of Map<String,Object> elements. Each element contains the ID of a record that was deleted and an array of errors, if there were any, for that record’s individual delete. For example, { results: [ { id: 'recordId', errors: ['errorMessage', ...]}, ...] }.
- Single and Batch Delete—Failure
- A map that contains a single element with the error message for the overall operation. For example, { error: 'errorMessage' }.
retrieve(type, fields, criteria)
Signature
public static Map<String,Object> retrieve(String type, List<String> fields, Map<String,Object> criteria)
Parameters
Return Value
Type: Map<String,Object>
The return value is a map that represents the result of the Remote Objects operation. What is returned depends on the results of the call.
- Success
- A map that contains the following elements.
- records: An array of records that match the query conditions.
- type: A string that indicates the type of the sObject that was retrieved.
- size: The number of records in the response.
- Failure
- A map that contains a single element with the error message for the overall operation. For example, { error: 'errorMessage' }.
update(type, recordIds, fields)
Signature
public static Map<String,Object> update(String type, List<String> recordIds, Map<String,Object> fields)
Parameters
Return Value
Type: Map<String,Object>
The return value is a map that represents the result of the Remote Objects operation. What is returned depends on how the method was called and the results of the call.
- Single Update—Success
- A map that contains a single element with the ID of the record that was updated. For example, { id: 'recordId' }.
- Batch Update—Success
- A map that contains a single element, an array of Map<String,Object> elements. Each element contains the ID of the record updated and an array of errors, if there were any, for that record’s individual update. For example, { results: [ { id: 'recordId', errors: ['errorMessage', ...]}, ...] }.
- Single and Batch Update—Failure
- A map that contains a single element with the error message for the overall operation. For example, { error: 'errorMessage' }.