AnsweredAssumed Answered

Add a custom filter to match current user

Question asked by Steve Cox on Aug 12, 2015
Hi,

I'm trying to create a custom filter for sidecar listviews. It's similar to the standard 'owner' filter - eg "My Accounts". However, it's actually filtering against a custom text field that contains a user ID.


In this case, the field is called mm_accounts_acctmngr_c


I've got this so far for custom/module/Accounts/client/base/filters/manager/manager.php:

$module_name = "Accounts";
$viewdefs[$module_name]['base']['filter']['manager'] = array(
    'create'               => false,
    'filters'              => array(
        array(
            'id'                => 'manager',
            'name'              => 'LBL_MANAGER_FILTER',
            'filter_definition' => array(
                array(
                    'mm_accounts_acctmngr_c' => '???',
                ),
            ),
            'editable'          => false,
        ),
    ),
);


 But I'm not sure what to use for '???' to reference the current user.

Any thoughts?

Outcomes