Here’s a great question that came out of the forums this week
I am trying to create a Dashlet that lists all Accounts that have no related Calls. In effect, I want to list all of the accounts that have never been called by our sales staff.
I have made many custom Dashlets before, but this is baffling me. Considering an account can have any number of calls related to it, I assume I would have to have some code that counts the number of related calls, and if this number == 0, then I can display this account record to the user in the dashlet list.
Is this even possible? How could I modify the overridden buildWhere() or process() functions for the generic dashlet? Is there someplace else I should be looking?
I am completely lost as to where to even begin. ANY help would be much appreciated.
I directed the poster to look at the overriding the process() method in that Dashlet’s class. After taking a look at the other examples we’ve done of this in the app ( modules/Calls/Dashlets/MyCallsDashlet/MyCallsDashlet.php is a good example ) the poster came back with a nice example of the code needed to do this, shown below:
All that’s needed is to set the various custom_ parameters that are passed to the ListViewSmarty class to add the extra query pieces needed to make this work.