How do I add Contracts module to the activity stream dashlet on my dashbaord

i would like to see the prompt on activity stream when someone created a new contract

Hi, @gzbenson,
Welcome to community! :tada:

I have example for module Tasks

  1. Make record in database directly.
    INSERT INTO config (category, name, value) VALUES (ā€˜sugarfeedā€™, ā€˜module_Tasksā€™, ā€˜1ā€™)

  2. Make file: custom/modules/Tasks/SugarFeeds/TaskFeed.php with that content. Watch out for names! ā€œTaskā€ is object name and ā€œTasksā€ is module name.

<?php
if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}

require_once('modules/SugarFeed/feedLogicBase.php');


class TaskFeed extends FeedLogicBase
{
    public $module = 'Tasks';
    public function pushFeed($bean, $event, $arguments)
    {
        global $locale;
        $text = '';
        if (empty($bean->fetched_row)) {
            $text =  '{SugarFeed.CREATED_TASK} [' . $bean->module_dir . ':' . $bean->id . ':' . $bean->name . ']';
        }
        
        if (!empty($text)) {
            SugarFeed::pushFeed2($text, $bean);
        }
    }
}
  1. Make file or add line to file: custom/modules/SugarFeed/language/en_us.lang.php
<?php
if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}
$mod_strings['CREATED_TASK']= 'created a <b>NEW</b> {0}';
  1. Make file or add line to file: custom/modules/Tasks/logic_hooks.php with content:
<?php
// Do not store anything in this file that is not part of the array or the hook version.  This file will	
// be automatically rebuilt in the future. 
 $hook_version = 1; 
$hook_array = Array(); 
// position, file, function 
$hook_array['before_save'] = Array(); 
$hook_array['before_save'][] = Array(1, 'Tasks push feed', 'custom/modules/Tasks/SugarFeeds/TaskFeed.php','TaskFeed', 'pushFeed'); 
?>
  1. Admin-> Repair->Quick Repair and Rebuild
1 Like

thank you for your information.