i would like to see the prompt on activity stream when someone created a new contract
Hi, @gzbenson,
Welcome to community!
I have example for module Tasks
-
Make record in database directly.
INSERT INTOconfig
(category
,name
,value
) VALUES (āsugarfeedā, āmodule_Tasksā, ā1ā) -
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);
}
}
}
- 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}';
- 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');
?>
- Admin-> Repair->Quick Repair and Rebuild
1 Like
thank you for your information.