AnsweredAssumed Answered

Using a custom filter in a custom view

Question asked by Steven Cox on Oct 18, 2018
Latest reply on Oct 22, 2018 by Eugene Bychkov

Hi,

 

I'm following the custom meeting view in:

 

https://mobiletools.sugarcrm.com/docs/latest/sdk/docs/sdk/tutorial-meetings-list-view.html 

 

Which has a filterDef as:

 

        this.collection.filterDef = {date_modified: {$dateRange: 'last_7_days',},};

 

However, I have an existing filter in the sugar instance which I want to refer to. That filter is defined in PHP in the client/base/view/filter/basic/filterScheduled.php file. It's quite complex and uses PHP functions, it's referred to as:

 

 

  $viewdefs['Meetings']['base']['filter']['basic']['filters'][] = array(

    'id' => 'filterMeetingByStatus',

    'name' => 'LBL_FILTER_MEETING_BY_STATUS',

    'filter_definition' => array(

        array(.......

 

 

How can I set this in the custom JS view? I'm hoping there's a way I can refer to it by the name 'filterMeetingByStatus'

 

I can select that filter from the filter list dropdown but I want to disable all filters with 

 

  isFilterEnabled: false,

So that this filter is always on.

 

Thanks

Outcomes