Hi,
Is there a way in which I can make unpaid invoices only show up at first when the user clicks on invoices.
The paid ones are still there, but one only accesses them through the search function.
Initially though, only unpaid invoices show up so that the user can quickly see their outstanding invoices.
Is this doable?
Thanks
Yes it is doable, you can add a WHERE clause to the custom listview defs. I wont go into the code as there are many examples of how to do this in the sugarcrm forums. You may also have a look into adding and an Initial filter.
if(!defined(‘sugarEntry’) || !sugarEntry) die(‘Not A Valid Entry Point’);
require_once(‘include/MVC/View/views/view.list.php’);
// name of class match module
class AOS_InvoicesViewList extends ViewList{
// where clause that will be inserted in sql query
var $where = "Status '3. Job Complete'";
function AOS_InvoicesViewList()
{
parent::ViewList();
}
/*
* Override listViewProcess with addition to where clause to exclude project templates
*/
function listViewProcess()
{
$this->lv->setup($this->seed, 'include/ListView/ListViewGeneric.tpl', $this->where, $this->params);
echo $this->lv->display();
}
}
I’ve tried this but it’s not working.