HOWTO: Customize the Content of SugarFeeds

sugarcrmdevelopers —  February 17, 2011 — 19 Comments

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.

19 responses to HOWTO: Customize the Content of SugarFeeds


    I am using 6.2.0 version.I followed the above procedure and got my module shown in My Activity stream dashlet but the event created is not been shown in the dashlet.


    There is one little error and you need to change the code in 2 places to suit your particular setup. The error is in/on this line

    $text = ‘Created Note [‘ . $bean->module_dir . ‘:’ . $bean->id . ‘:’ . $bean->name.’];

    It needs the closing single quote AFTER the last square bracket,. Should be
    $text = ‘Created Note [‘ . $bean->module_dir . ‘:’ . $bean->id . ‘:’ . $bean->name.’]’;

    You should change the class name to match the name of the php file AND the name of the module to suit. Worked perfectly for me once I made those changes on Sugar 6.3


    In 6.3 what should I name the php file and module?  I have named it NoteFeed.php under the dir: modules/Notes/SugarFeeds but it doesn’t show up in the dash let but is shown in the Admin feed page…


      You need to enable it for the Dashlet in the Dashlet config popup ( click the little gear icon on the Dashlet title menu to get there )


    Hi  John Mertic,This blog is working fine for me, I followed the blog and I added the Notes, and many more modules into the Activity Stream.Now, I want to know Is there any way to show this Activity Stream in a menu bar just like Accounts, Contacts, Leads and rest of module are showing in the menu bar.Looking forward for your reply…..Thanks & RegardsSumit


    Just trying to do this with 6.5.4 to work with quotes but can’t get it to shown in the Feed administration as a check box. Therefore I also tried this with the “notes” example in this blog with no luck. Any ideas?


    Hello, thanks for the code, it works for me on 6.5.11. But i couldn’t understand how to tune my activity stream to feed on assignment, for example, when the task was assigned to the curent user from his boss, he need to see that fact in the activity stream. I already have the code on creating tasks, but when i adding the ELSE condition with ASSIGNED_TASK or ASSIGNED_CONTACT in ContactFeed, i received the error message. How can i track assignment in activity stream? Thank you in advance

    disqus_PAkBoCjv5P May 8, 2013 at 10:51 pm

    How to ‘DocumentRevision’ to the ‘Sugar Feed’?

Trackbacks and Pingbacks:

  1. Tweets that mention Sugar Developer Blog » Blog Archive » HOWTO: Customize the Content of SugarFeeds -- - February 17, 2011

    […] This post was mentioned on Twitter by Loaded Technologies, sugarcrmdev. sugarcrmdev said: HOWTO: Customize the Content of SugarFeeds #sugarcrm […]

  2. Sucking less every day › Customizing Sugar Feeds - February 23, 2011

    […] quite a bit of googling I came across this entry. Basically it says that I should create a new file with the logic I need and place it at a […]

  3. Adding custom modules in My Activity Stream - SugarCRM Forums - December 12, 2011

    […] […]

  4. How to display any updates from any users? - SugarCRM Forums - December 16, 2011

    […] […]

  5. How to notify relate field usage in Notification Dashlet - September 26, 2012

    […] […]

  6. Sugar Feeds - September 27, 2012

    […] […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s