1

When using remote objects, is it possible to override the default retrieve method so that nothing is returned unless a where query is present?

0

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.

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

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy