I recently needed to add some custom functionality to a Dashlet for a Custom Module in SugarCRM and this is the story of how I did it.
Let’s say your custom module is called MyModule and you have build it in Studio.
The folder where you would work your magic would be located at /custom/modules/MyModule/Dashlets/MyModuleDashlet/
In there you should find two files – MyModuleDashlet.meta.php and MyModuleDashlet.php
MyModuleDashlet.meta.php basically does what it says on the tin, i.e. it tells Sugar about your dashlet – which module it relates to, it’s title, description, icon and category.
MyModuleDashlet.php is where you can do your kung fu. Just as a brief example in the “process” function try setting the “title” property to something like “HELLO WORLD”:
$this->title = “HELLO WORLD”;
If you want to modify the default Dashlet title or any other of the labels for your dashlet you can create a file in /custom/modules/MyModule/language/en_us.lang.php – if you don’t have the file present then you can copy it across from /modules/MyModule/language/
Go to the admin area, Repair, Rebuild Dashlets and see what happens.