How can I change the default filter on a list view

I have created a global custom filter on the accounts list view (show all accounts that do not have a parent_id)

This is working but I need to manually select the filter for the list view to display the accounts satisfying the filter

My requirement is to have this filter as the default filter instead off all_records

I tried changing custom\modules\Accounts\clients\base\filters\default\default.php by changing 

  'default_filter' => 'all_records',
to
  'default_filter' => 'filterParentAccounts',
and doing a QRR but that did not work, Any suggestions would be appreciated
  • Hello  , 

    Thank you for creating this!

    When you load a new filter on a ListView and then navigate away, the filter settings are saved in the users_last_states database table for your user account. If you return to the same ListView, the filter will remain the same—even if you log out and log back into Sugar.

    If your goal is to create a filter available to all users, you can create a predefined filter by following the guide linked here:

    https://support.sugarcrm.com/documentation/sugar_developer/sugar_developer_guide_13.2/architecture/filters/#Adding_Predefined_Filters_to_the_List_View_Filter_List


    After creating the predefined filter, you can override the default.php to make it the default for all users on that ListView.
    However, keep in mind that this default filter will only apply on the users’ first access to that ListView.

    Once a user selects another filter and navigates away from the ListView, their new filter choice will be saved in the users_last_states table. This saved filter will then become their default when they return to the ListView.

    I hope this explanation clarifies how default filters function.

    Let me know if you have further questions!


    Cheers, 

    André