In our previous “Hello World” dashlet post, we established what a minimal dashlet entailed. In these next post, we’ll be building on those skills to create a more useful dashlet that takes advantage of Sugar 7 List Views. We will be creating a dashlet for Cases that binds to the list’s Collection and sums the number of Cases by their status. So if the Cases list contains 5 records, and 3 of those are in “New” state and 2 are in “Closed” state then we want our dashlet to display “New: 3″ and “Closed: 2″. To the code!
Again, using what we learned in the previous post, we’re going to create a folder in custom/clients/base/views/ called “case-count-by-status“. Inside that folder you should create 3 files:
While technically optional, we will also utilize the Language extension in order to provide multilingual support for our example dashlet. This extension file will be located at custom/Extension/application/Ext/Language/en_us.case-count-by-status.php.