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
  • Hi, do you need to do this because the same 'current user' is not the same as the Cases assigned to person?
    If yes, is it because they are the Account manager and this requirement is for them to have an overview of any Cases for their Accounts?
    No code solution exists for this if you or others are interested:

    Create a report based on Cases module, and use the filter that selects 'Current user'.
    Cases > Account > Assigned to User > User Name    


    This report is then easily added to Dashboards



    Hope that helps?

    .

    CRM Business Consultant

Reply
  • Hi, do you need to do this because the same 'current user' is not the same as the Cases assigned to person?
    If yes, is it because they are the Account manager and this requirement is for them to have an overview of any Cases for their Accounts?
    No code solution exists for this if you or others are interested:

    Create a report based on Cases module, and use the filter that selects 'Current user'.
    Cases > Account > Assigned to User > User Name    


    This report is then easily added to Dashboards



    Hope that helps?

    .

    CRM Business Consultant

Children
No Data