SugarFeeds is a feature we added to the product back in 5.2, which not only provides a “social aspect” to SugarCRM by allowing users to make posts for everyone to see, but it also enables the system to report certain activities done within the application for everyone else to view. The latter aspect is one of the most intriguing for developers, where we use the built in before_save logic hook mechanism of Sugar to write out data to the SugarFeeds module.
Today I saw this forums post where a user was looking to override the default behavior of reporting converted leads to the SugarFeeds dashlet. This is a simple task, since we can drop in a replacement class at custom/modules/Leads/SugarFeeds/LeedFeed.php that will override the default one defined at modules/Leads/SugarFeeds/LeedFeed.php. The replacement file will look something like this:
Let’s say you would like to enable a new module to use SugarFeeds, for example the Notes module. To do this, first drop in the class to implement the logic to create the feed entry into the custom/modules/Notes/SugarFeeds/ directory ( naming doesn’t matter, but for this example we can go with NoteFeed.php )
Next you need to enable the feed in the Sugar Feeds admin panel. If you’ve created the feed class shown above, it show just up as one of the checkbox items of modules to enable; just checkbox that and the feed will be enabled.
Now when you save a new note, it will appear in the SugarFeeds dashlet.