I’d like to add a custom field as filter to the standard Sales Pipeline diagram on the SuiteCRM Dashboard.
Can somebody give me some pointers?
I managed to do this for simple list Dashlets a while back via /custom/module/[Module name]/metadata/dashletviewdefs.php
But I see no such thing for module “opportunities”.
It seems the relevant code is under modules/Charts/Dashlets/PipelineBySalesStageDashlet.php. But I don’t know where to start to add a custom field as custom filter… would appreciate any help.
Hi,
Some Steps to move forward
1: Open modules\Charts\Dashlets\MyPipelineBySalesStageDashlet\MyPipelineBySalesStageDashlet.php
Modify constructQuery function to put your Field in the Query
2: In displayOptions function, set DROPDOWN options for your field if it is a dropdown field else skip this step
3: Declare a new variable for your field in the beginning after this line public $mypbss_date_end;
like
public $your_field_name;
4: Open the file modules\Charts\Dashlets\MyPipelineBySalesStageDashlet\MyPipelineBySalesStageConfigure.tpl and put you field there after this TR
<tr>
<td valign='top' class='dataLabel' nowrap>{$LBL_SALES_STAGES}</td>
<td valign='top' class='dataField'>
<select name="mypbss_sales_stages[]" multiple size='3'>
{$selected_datax}
</select></td>
</tr>
5: Define your search filed into modules\Charts\Dashlets\MyPipelineBySalesStageDashlet\MyPipelineBySalesStageDashlet.data.php
Like
'custom_field_name' => array(
'name' => 'custom_field_name',
'vname' => 'LBL_FIELD',
'type' => 'enum',
),
6: Repair and Rebuid the CRM and also try to clean cache
That’s it.
Thanks a lot
2 Likes