Showing changes to custom modules in activity stream?

Does anyone know how do I get the activity stream to show the changes that a user makes instead of the Administrator?

Right now it shows what the Administrator did ( Example: Admin created new opportunity at $??? etc )

How do I get it to show what a USER does and not a administrator?

1 Like

Hello,

If you create opportunity with the regular user, It should appears on the Activity Stream dashlet as well.

2 Likes

Sorry I have made a mistake.

I meant how do I get it to work in custom modules, the same way as it works in the opportunity module?

Like if an admin creates an opportunity, It’s on the activity stream but if I make a record in a custom module, there’s nothing in the activity stream.

1 Like

Hello,

You can follow logic hook files in custom/modules/Opportunities/logic_hooks.php and find “Opportunities push feed” logic hook and create same for your custom module.

1 Like

Thank you!

So I just copy this

$hook_array[‘before_save’][] = Array(1, ‘Opportunities push feed’, ‘modules/Opportunities/SugarFeeds/OppFeed.php’,‘OppFeed’, ‘pushFeed’);
$hook_array[‘after_save’] = Array();

and change the module names to my custom module name? Where do I put this line of code?

1 Like

Hello,

You need have little knowledge for programming to perform this.
You have to create logic_hooks.php file at custom/modules//logic_hooks.php and define array first then logic hook definition.
In above example you have define the logic hook definition then you are making it empty again.

  1. You have to define logic hook
  2. You have to create respective files as it is in definition of logic hook
2 Likes

Hmm, can I just copy the codes in the Opportunities module and use it?

<?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(77, 'updateGeocodeInfo', 'custom/modules/Opportunities/OpportunitiesJjwg_MapsLogicHook.php','OpportunitiesJjwg_MapsLogicHook', 'updateGeocodeInfo'); $hook_array['before_save'][] = Array(1, 'Opportunities push feed', 'modules/Opportunities/SugarFeeds/OppFeed.php','OppFeed', 'pushFeed'); $hook_array['after_save'] = Array(); $hook_array['after_save'][] = Array(77, 'updateRelatedMeetingsGeocodeInfo', 'custom/modules/Opportunities/OpportunitiesJjwg_MapsLogicHook.php','OpportunitiesJjwg_MapsLogicHook', 'updateRelatedMeetingsGeocodeInfo'); $hook_array['after_save'][] = Array(78, 'updateRelatedProjectGeocodeInfo', 'custom/modules/Opportunities/OpportunitiesJjwg_MapsLogicHook.php','OpportunitiesJjwg_MapsLogicHook', 'updateRelatedProjectGeocodeInfo'); $hook_array['after_relationship_add'] = Array(); $hook_array['after_relationship_add'][] = Array(77, 'addRelationship', 'custom/modules/Opportunities/OpportunitiesJjwg_MapsLogicHook.php','OpportunitiesJjwg_MapsLogicHook', 'addRelationship'); $hook_array['after_relationship_delete'] = Array(); $hook_array['after_relationship_delete'][] = Array(77, 'deleteRelationship', 'custom/modules/Opportunities/OpportunitiesJjwg_MapsLogicHook.php','OpportunitiesJjwg_MapsLogicHook', 'deleteRelationship'); ?>

Can I use that and change the module name to my custom module name? Will that work? Sorry I don’t really know much about programming.

1 Like

sounds like you need someone to help you with this.

however you need to do two things here as urdhvatech has said.

you need to create a new logic hook for the given module

$hook_array[] = Array(1, ‘Opportunities push feed’, ‘custom/modules/Opportunities/SugarFeeds/OppFeed.php’,‘OppFeed’, ‘pushFeed’);

You then need to create the file that you have just defined

custom/modules/Opportunities/SugarFeeds/OppFeed.php

and populate this with the correct code so it populates the activity feed. which you can see an example of this file in the cases module

modules/Cases/SugarFeeds/CaseFeed.php

you would need to update the correct sections in this file if you were to copy it.,

Ian.

2 Likes