When using remote objects, is it possible to override the default retrieve method so that nothing is returned unless a where
query is present?
1 Answer
You can do that.
First you need to override the retrieve method in your definition:
retrieve="{!$RemoteAction.<YOURCLASSNAME>.retrieve}"
secondly you need to implement that class and method:
@RemoteAction
public static Map<String, Object> retrieve(String type,
List<String> fields,
Map<String, Object> criteria) {
Map<String, Object> result = RemoteObjectController.retrieve(type,
fields,
criteria);
return result;
}
then just add your if clause inside that method (the example just executes the original method.