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 1


You can do that.

First you need to override the retrieve method in your definition:


secondly you need to implement that class and method:

public static Map<String, Object> retrieve(String type,
                                         List<String> fields,
                                         Map<String, Object> criteria) {
  Map<String, Object> result = RemoteObjectController.retrieve(type,

  return result;

then just add your if clause inside that method (the example just executes the original method.

Read more here: http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#CSHID=pages_remote_objects_using_override_actions.htm|StartTopic=Content%2Fpages_remote_objects_using_override_actions.htm|SkinName=webhelp

You must log in to answer this question.