SugarCRM searches in opportunities for amounts with a standard search-like-clause.
So if you enter 100000 in the Advanced Search Amount field you will get a where clause
If you want to search for 100000 exactly or for more or less than 100000 you can do this by a little patch in module /include/MVC/View/views/view-list.php.Code:opportunities.amount like '100000%'
Here clause manipulation can be added before the line
E.g. you can add the following code for opportunities before the above printed line:Code:if (count($where_clauses) > 0 )$where = '('. implode(' ) AND ( ', $where_clauses) . ')';
Now you can enter “100000” and the where clause will beCode:if ( $this->seed->module_dir == "Opportunities" ) { foreach($where_clauses as $dakey => $dawert) { if(substr($dawert,0,27)=="opportunities.amount like '") { $datest= substr($dawert,27,1); $daop = "%"; if ($datest == ">") $daop=">"; if ($datest == "<") $daop="<"; if ($datest == "=") $daop="="; if ($daop != "%") { // remove test-char $dawert = str_replace($daop,"",$dawert); // remove % $dawert = str_replace("%","",$dawert); // replace like by new operation $dawert = str_replace("like",$daop,$dawert); // replace original where clause $where_clauses[$dakey] = $dawert; } } } }
If you enter “>100000” the where clause will beCode:opportunities.amount like '100000%'
The corresponding applies to “<1000000” and “=100000”.Code:opportunities.amount > '100000'


LinkBack URL
About LinkBacks



Reply With Quote
Fan Of Sachin Tendulkar

Bookmarks