Hi Guys,
I make a custom field birthdate for SugarCRM in Accounts Module. And I want to display it in My Accounts Dashlet in HOME page.
And I succeeded by edit and add this code in include\Dashlets\DashletGeneric.php :
$widgetClass = $this->layoutManager->getClassFromWidgetDef($widgetDef, true);
// $widgetDef['table'] = $this->seedBean->table_name;
// $widgetDef['table_alias'] = $this->seedBean->table_name;
/** [eggsurplus] 2009/01/06 - support custom fields in dashlets */
if(isset($this->seedBean->field_defs[$name]['source']) && $this->seedBean->field_defs[$name]['source']=='custom_fields'){
$widgetDef['table'] = $this->seedBean->table_name.'_cstm';
$widgetDef['table_alias'] = $this->seedBean->table_name.'_cstm';
}else{
$widgetDef['table'] = $this->seedBean->table_name;
$widgetDef['table_alias'] = $this->seedBean->table_name;
}
and add these lines into modules\Accounts\Dashlets\MyAccountsDashlet\MyAcco untsDashlet.data.php :
'birthdate_c' => array('default' => ''),
AND :
'birthdate_c' => array( 'width' => '5',
'label' => 'LBL_BIRTHDATE',
'default' => true
),
And it's working fine. But the problem is : I want to the dashlet to show all acounts that have birthdate today, so I need just to consider the date and month to today's date. Currently it's considering the date, month AND year to filter.
For that, I need to have custom query for this particular dashlet.
Where and how should I put the custom query?
Any help would be very appreciated guys.


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks