I’ve had a look and, oddly enough, I’m also not able to limit the query by making a Custom version of that Dashlet in the /custom/ folder
There must be something else that connects or protects this dashlet’s content that I’ve not yet found
However, it looks like you might be able to make an identical Custom Dashlet, but with the limit included, if that sounds like a solution for you?
and rename it, ie:
and update the Class name on line 49 accordingly in this new custom file,
(and feel free to change the query limit):
Then do the same for the metadata file:
and rename it similarly, ie:
In this new xxxx.meta.php file, make some changes to differentiate it from the core Top Campaigns.
ie, I’ve changed the content of the file to the below:
$dashletMeta['limitTopCampaignsDashlet'] = array('module' => 'Campaigns',
'title' => translate('LBL_LIMIT_TOP_CAMPAIGNS', 'Campaigns'),
'description' => translate('LBL_LIMIT_TOP_CAMPAIGNS_DESCRIPTION', 'Campaigns'),
'category' => 'Module Views');
(This changes the dashletMeta link as well as the two labels used)
Then, create a file at:
And add these two language files, ie:
$mod_strings['LBL_LIMIT_TOP_CAMPAIGNS'] = 'Limited Top Campaigns';
$mod_strings['LBL_LIMIT_TOP_CAMPAIGNS_DESCRIPTION'] = 'Limited Top Campaigns';
After running a “Quick Repair and Rebuild” and “Rebuild SuiteCRM Dashlets”
You should see this new dashlet as an option on the Homepage, but let me know if you run into any issues!
From here, you should be able to make any changes you want to the query in the
“LimitTopCampaignsDashlet.php” file, (including limiting to one result), which then should be reflected in the CRM
Hopefully something like the above can help at all!