This is the second in a series of articles discussing the creation of Custom Gadgets that can be added to the Interactive Dashboard in Sage CRM.

In the article "An Example Custom Gadget for the Interactive Dashboard" I mentioned that data is passed to and from Custom Gadgets in JSON format. 

In the image below you can see that a new field called "comp_twittername" has been added to the Company table.

You can see that I have set up two Gadgets in the Interactive Dashboard below.

  • The first Gadget is a List Gadget displaying Companies that use a Group as its datasource.
  • The second Gadget is a simple Custom Gadget used in Training.

You can see that the second Gadget displays the fields that have been passed from the List Gadget to the Custom Gadget.

I will discuss how to code a custom Gadget in another article. But clearly the JSON formatted data does not contain comp_twittername:

'{"entityRecordId":"1228", "entityFilteredBy":"Sage Ireland", "comp_primaryuserid":"", "comp_channelid":"", "comp_primaryaddressid":"1781", "comp_primarypersonid":"1781", "comp_companyid":"1228", "comp_name":"Sage Ireland", "addr_city":"Dublin", "comp_phonefullnumber":"1890 88 2060", "comp_emailaddress":"", "comp_website":"", "comp_secterr":"-1879048183"}'

What controls the Data Sent?

The data sent to the custom Gadget is controlled by the data source used by the 'publishing' Gadget.

For example List Gadgets get their data from one of the following

  • Groups
  • Reports
  • Saved Searches 
  • Advanced Finds

This means that if I alter the columns returned by the Group definition used by my List Gadget then the columns of the Group definition will be available to be published to the Custom Gadget.

This works in the same for Reports and Advanced Find data sources.

The List Gadget used above is based on a Group that has the following definition:

Note:  I have assumed that you are familiar with creating Dynamic Groups.  If this topic is new to you then please refer to the documentation.  

I can now add the new comp_twittername field into the Group Contents.

Once the new Group definition has been saved then this will change the data that is passed by any Gadget based on the group to any other Gadget including our Custom Gadget.

And the JSON data now looks like

'{"entityRecordId":"1228", "entityFilteredBy":"Sage Ireland", "comp_primaryuserid":"", "comp_channelid":"", "comp_primaryaddressid":"1781", "comp_primarypersonid":"1781", "comp_name":"Sage Ireland", "addr_city":"Dublin", "comp_companyid":"1228", "comp_phonefullnumber":"1890 88 2060", "comp_emailaddress":"", "comp_website":"", "comp_secterr":"-1879048183", "comp_twittername":"sageireland"}'

Once I know that my data source will pass the data I need then I can use it in my Custom Gadget.