0

Hy Guys! I am facing a problem regarding datetime field display in Popup. If i add a datetime field to Advanced Search of ProspectLists it get displayed as shown below and works perfectly:

enter image description here

in the custom modules ProspectLists searchdefs advanced_search array it is defined as :

array (
    'type' => 'datetime',
    'label' => 'LBL_DATE_ENTERED',
    'width' => '10%',
    'default' => true,
    'name' => 'date_entered',        ),

but when i try to select a ProspectList from a Prospect List subpanel in Campaigns, the popup that gets displayed render the date field with out dropdown as shown below:

enter image description here

The other problem is this that when i perform search from popup for a specific date it displays nothing.

I am using SugarCRM CE 6.5.11. Any idea how to display dropdown with date field.?

Sheikh Rahat Ali
  • 1,293
  • 8
  • 37
  • 61

2 Answers2

1

In method SugarFieldBase::isRangeSearchView you should check condition $_REQUEST['action']!='Popup'

File include/SugarFields/Fields/Base/SugarFieldBase.php

I remove it from conditions.

protected function isRangeSearchView($vardef)
{
    //return !empty($vardef['enable_range_search']) && !empty($_REQUEST['action']) && $_REQUEST['action']!='Popup';
    return !empty($vardef['enable_range_search']) && !empty($_REQUEST['action']);

}
dimaqw
  • 637
  • 6
  • 9
  • yes, it shows the date range search, but it always returns all records in the search (the date chosen in the field is ignored when pushing 'search') – Rodniko Mar 01 '16 at 06:53
0

I think what you're looking for is the "Ranged Search" attribute.

You can enable it in studio by going to the custom field and checking the "Enable Range Search" checkbox.

Or, you can edit the custom/modules/{module}/metadata/SearchFields.php and add the following to the field in question:

'enable_range_search' => true
Chad Hutchins
  • 474
  • 3
  • 9
  • added it to array ( 'type' => 'datetime', 'label' => 'LBL_DATE_ENTERED', 'width' => '10%', 'default' => true, 'name' => 'date_entered', 'enable_range_search' => true ), but still facing the same problem of not having operators dropdown in popup. Any way thankx for reply. – Sheikh Rahat Ali Sep 11 '13 at 13:48
  • 1
    You need to add it to SearchFields.php not searchdefs.php. They are in the same folder. If one doesn't exist in custom/modules/{module}/metadata/ copy modules/{module}/metadata/SearchFields into custom/modules/{module}/metadata – Chad Hutchins Sep 11 '13 at 18:08