Hello all,
is there a way to search for a range of results? For instance, i have a field called employee count, can i search for all companies with a range of 50-100 employees? is there a syntax i can use for this? i have tried a few with no luck
Hello all,
is there a way to search for a range of results? For instance, i have a field called employee count, can i search for all companies with a range of 50-100 employees? is there a syntax i can use for this? i have tried a few with no luck
SugarCRM 5.1.0c
Windows Server 2003 R2
XAMPP Installation
Apache / MySQL
Check this out: http://www.sugarforge.org/projects/enhancedsearch/
If this isn't what you're after you may want to look at Jasper or smthg similar.
rgds
__________________________
Robert Laussegger
http://www.iscongroup.net
Bei Fragen: support@iscon.at
Die deutschen Sprachdateien für SugarCRM und das deutsche Handbuch gibt es hier: http://goo.gl/kPsAz
Ab sofort auch mit 6.4.2
Hi gerald29,
You can do that in modules/<MODULE_NAME>/ListView.php, after Sugar defines the $where_clauses.
Folow is an example:
PHP Code:
if (isset($_REQUEST['date_begin'])) $date_begin = $_REQUEST['date_begin'];
if (isset($_REQUEST['date_end'])) $date_end = $_REQUEST['date_end'];
$where_clauses = generate_search_where($searchFields,$_REQUEST,$seedProposal,true,"Proposals");
if(isset($date_begin) && $date_begin != ""){
$date_begin_dbformat = $timedate->swap_formats($date_begin, $timedate->get_date_format(), $timedate->dbDayFormat);
array_push($where_clauses, "proposals.date >= '".PearDatabase::quote($date_begin_dbformat)."'");
}
if(isset($date_end) && $date_end != ""){
$date_end_dbformat = $timedate->swap_formats($date_end, $timedate->get_date_format(), $timedate->dbDayFormat);
array_push($where_clauses, "proposals.date <= '".PearDatabase::quote($date_end_dbformat)."'");
}
In this case I do the range search for date field in Proposal Module. you going to do for your module.employees.
I hope this helps.
Diego Lorenzetti
Lampada Global Services - Open Source Solutions
Phone: +55 11 3237-3110
Email: equipe@lampadaglobal.com
Site: www.lampadaglobal.com
Lampada Global delivers offshore software development and support services to customers around the world.
Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks