SugarCRM 7.6  Dashlet Graphs related to contact being viewed, how?

Hi,

In a bit of a pickle; i know dash-lets can be used across different modules including custom modules. however i cant figure out how to get the dash-let graphs/lists to target the modules relationship.

For example, i want to track a contacts statistics and want this displayed as a dash-let so i need some way of creating a relationship with the primary page to a dash-let.

At current from what i know its impossible, but if someone can point me in the right direction that would help massively.

Regards

Dan.

  • Hi Dan,

    I am not clear on the goal of your customization. Are you trying to read data of the primary record on screen through the dashlet? For example, if I am on a contact record for "Angel Magaña" and in a custom dashlet I want to read the last_name field, I can do that. To do so, I would use the following code in the JS controller for the dashlet:

    var last_name = this.model.get('last_name');

    If I want records that are related to "Angel Magaña," with the intent to display them or something related to them on the dashlet, there is a way to do that as well. One way would be through the getRelatedCollection() method.

    Perhaps the above will help answer your question, if not, please elaborate on your goal so we may have a clearer understanding.

  • You got it in one!.. getRelatedCollection() is something i will need to look into.

    The aim is to load related data or graphs to the contact im looking at. so based on your example if i pull up a contact called 'Angel Magaña' i want to be able to see dashlets related maybe recent activity, transactions, campaigns etc..

    Thanks again.