Custom views sort handler without table I am trying to expose data fetched from remote API and stored to $user object. I have accomplished that with a custom views handler suggested in this post Custom views handler without table. 

However, I need to add sorting and filtering, so any help will be great.

This is the custom views field handler code.

/**
 * A handler to provide a field that shows the license type.
 *
 * @ingroup views_field_handlers
 */
class views_handler_apms_license extends views_handler_field {

  function query() {
    // do nothing -- to override the parent query.
  }

  function option_definition() {
    $options = parent::option_definition();

    // Override the alter text option to always alter the text.
    $options['alter']['contains']['alter_text'] = array('default' =&gt; TRUE);
    return $options;
  }

  function options_form(&amp;$form, &amp;$form_state) {
    parent::options_form($form, $form_state);

    // Remove the checkbox
    unset($form['alter']['alter_text']);
    unset($form['alter']['text']['#dependency']);
    unset($form['alter']['text']['#process']);
  }

  function render($values) {
    $user = user_load($values-&gt;uid);
    if (isset($user-&gt;apms['userLicense'])) {
      return $user-&gt;apms['userLicense'] ? t('BASIC') : t('FREE');
    }
    else {
      return NULL;
    }
  }
}
You can use the post_execute() method on your handler to remove entries from the list of all results. This is certainly a bit tricky but it works.