Create Custom Filter to Cases

Hi Everyone!

I need to create a custom filter module for cases.

The "cases" module has a relationship with the "accounts" module, so the custom filter should show in my "cases" list view, only the records that its relationship with "accounts" its label "user assigned to" is equal to the current logged in user.

Actually I have this code:

global $current_user;
$viewdefs['Cases']['base']['filter']['basic']['filters'][] = array(
    'id' => 'filterCasesAccounts',
    'name' => 'LBL_FILTER_CASES_ACCOUNTS_TEMPLATE',
    'filter_definition' => array(
        array(
            'account_cases' => array(
                '$in' => array(
                    'assigned_user_id' => array(
                        '$equals' => $current_user->id,
                    ),
                ),
            ),
        ),
    ),
    'editable' => false,
    'is_template' => false,
);
How could I do this filter?
Thank you!
Parents Reply Children
No Data