Custom Date field "range Search" does not show in "Popup Search"

Hello,

I Created a Date Field in the Accounts module called "Founded Date" and marked the "Range Search" property so i could find Accounts in a range of dates.

i added the field to the basic search and the Popup Search.

In the Basic Search i see the range search:

range3.png

But when i get inside Cases module and Create a new case and click on the Accounts relate field,

i see the Date Field without the range search in the Search Popup of Accounts:

range4.png

i read about it online.

i changed the row in file include/sugarFields/Fields/Base/SugarfieldBase.php from this:

return !empty($vardef['enable_range_search']) && !empty($_REQUEST['action']) && $_REQUEST['action']!='Popup';

to this

return !empty($vardef['enable_range_search']) && !empty($_REQUEST['action']);

So now i see it as ranged search but the date is ignored completely when pushing "Search" !

i choose "Equals to" = 2/3/2016 but it still shows the account with 9/3/2016 value in Founded Date field:

range5.png

how can i make the field take part of the search?

please help!

Using Sugarcrm CE 6.5.13

Parents Reply
  • Hi Asaf,

    Again, this solution is NOT upgrade-safe and these changes will be lost if/when you upgrade. That said, you can try adding the following at line 295 of include/Popups/PopupSmarty.php:

    if(file_exists('custom/modules/'.$this->module.'/metadata/SearchFields.php')) {
        require('custom/modules/'.$this->module.'/metadata/SearchFields.php');
    }
    

    Let me know if that helps!

    -Alan

Children
  • Yes!!!! it works!!!

    You are a life saver thank you!

    Let me clarify the solution you gave because it took me time to understand where to put the code.

    around line 295, add the above (Alan Reply) code above the code that uses the 'modules/'.$this->module.'/metadata/SearchFields.php' file like this:

    if(file_exists('custom/modules/'.$this->module.'/metadata/SearchFields.php'))

      { 

        require('custom/modules/'.$this->module.'/metadata/SearchFields.php'); 

      } 

      else if(!empty($metafiles[$this->module]['searchfields'])) {

      require($metafiles[$this->module]['searchfields']);

      } elseif(file_exists('modules/'.$this->module.'/metadata/SearchFields.php')) {

      require('modules/'.$this->module.'/metadata/SearchFields.php');

         }