3

I am trying to create a filter in SugarCRM 7.7. I am working in a custome module.

My new filtername is 'Next Review Date'. enter image description here

I have created a file inside my src/modules/mynewfiltermodule/clients/base/filters/nextreviewdate/nextreviewsate.php

$viewdefs[$module_name]['base']['filter']['nextreviewdate'] = array(
'create'               => false,
'filters'              => array(
    array(
        'id'                => 'nextreviewdate',
        'name'              => 'LBL_NEXT_REVIEW_DATE_ONLY_FILTER',
        'filter_definition' => array(
            array(
                'next_review_date' => 'orderby ASC',
            ),
        ),
        'editable'          => false,
    ),
),

);

I want to orderby the field in next_review_date in ASC order, It is a date field.

Can someone help me. How can i do it?

DonOfDen
  • 3,968
  • 11
  • 62
  • 112

1 Answers1

2


http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.5/UI_Model/Views/Filters/index.html

In this link there is no way of sorting in filter. But i Have an idea , you use your filter and apply the default filter there.
in

custom/modules/module_name/clients/base/views/list/list.php

 'orderBy' => 
        array (
          'field' => 'nextreviewdate',
          'direction' => 'ASC', 
        ), 

this will Set the default Sorting order.I found only this solution .
I think This may help you.

Amitesh Kumar
  • 3,051
  • 1
  • 26
  • 42