AnsweredAssumed Answered

Default sort order field in subpanel not working 6.5

Question asked by tobydz on Feb 1, 2016
Latest reply on Feb 5, 2017 by Jeff C

This is literally driving me insane.  I am trying to default sort a custom date field in a custom module subpanel.  Here's what I have done:

 

Background:

PI_Personal_Injury is the parent module

INV_Time_And_Expenses is the module subpanel

The field I am trying to sort by is called 'input_date_c'

 

In the parent module custom directory, I have edited the file: custom/modules/PI_Personal_Injury/Ext/Layoutdefs/layoutdefs.ext.php

Here are the contents:

$layout_defs["PI_Personal_Injury"]["subpanel_setup"]['pi_personal_injury_inv_time_and_expenses'] = array (

  'order' => 100,

  'module' => 'INV_Time_And_Expenses',

  'subpanel_name' => 'default',

  'sort_order' => 'asc',

  'sort_by' => 'input_date_c',

  'title_key' => 'LBL_PI_PERSONAL_INJURY_INV_TIME_AND_EXPENSES_FROM_INV_TIME_AND_EXPENSES_TITLE',

  'get_subpanel_data' => 'pi_personal_injury_inv_time_and_expenses',

  'top_buttons' =>

  array (

    0 =>

    array (

      'widget_class' => 'SubPanelTopButtonQuickCreate',

    ),

    1 =>

    array (

      'widget_class' => 'SubPanelTopSelectButton',

      'mode' => 'MultiSelect',

    ),

    2 =>

    array (

      'widget_class' => 'SubPanelTopCreateInvoiceButton',

    ),

  ),

);

 

After changing the sort_order, and the sort_by entries, I ran a QRR, cleared my browser cache, and even went so far as to reset the entire directory permissions and run a QRR again.  I had reached out to support prior to this nightmare endeavour, and they pointed me to this article:

http://stackoverflow.com/questions/30610322/how-to-change-default-sort-in-custom-subpanel-sugarcrm

 

That didn't work... upon further research, I found this article:

https://community.sugarcrm.com/thread/21956?q=Default%20sort%20order%20subpanel

 

After reading that article, I edited the file /custom/Extension/modules/PI_Personal_Injury/Ext/Layoutdefs/pi_personal_injury_inv_time_and_expenses_PI_Personal_Injury.php

Here are the contents:

$layout_defs["PI_Personal_Injury"]["subpanel_setup"]['pi_personal_injury_inv_time_and_expenses'] = array (

  'order' => 100,

  'module' => 'INV_Time_And_Expenses',

  'subpanel_name' => 'default',

  'sort_order' => 'asc',

  'sort_by' => 'input_date_c',

  'title_key' => 'LBL_PI_PERSONAL_INJURY_INV_TIME_AND_EXPENSES_FROM_INV_TIME_AND_EXPENSES_TITLE',

  'get_subpanel_data' => 'pi_personal_injury_inv_time_and_expenses',

  'top_buttons' =>

  array (

    0 =>

    array (

      'widget_class' => 'SubPanelTopButtonQuickCreate',

    ),

    1 =>

    array (

      'widget_class' => 'SubPanelTopSelectButton',

      'mode' => 'MultiSelect',

    ),

    2 =>

    array (

      'widget_class' => 'SubPanelTopCreateInvoiceButton',

    ),

  ),

);

 

...again, I ran a QRR, cleared my browser cache, reset the entire directory permissions and run a QRR again. And it STILL. DOESN'T. WORK.

 

Please help before another wireless mouse meets a horrifying, fiery end.....

 

I'm running 6.5.20 on a LAMP stack

Outcomes