I have created a custom field 'eng_sum_c' (decimal type) in Leads.
I also created a tracker based campaign and executed it as sample, and got the email delivered at my email id. When I click on the URL link (hyperlink), everything goes fine and the behavior is correctly recorded in 'Campaign' subpanel of Lead's DetailView.
I know that most of the data presented in 'Campaign' subpanel is obtained from module 'CampaingLog' & 'Campaign' module. For example, Activity Type data is coming from 'CampaignLog' field 'activity_type'. Related data is coming from 'Campaign' field 'tracker_url'.
$hook_version = 1;
$hook_array = Array();
// position, file, function
$hook_array['after_save'] = Array();
$hook_array['after_save'] = Array(1, 'Eng Score via CampaignLogs', 'custom/modules/CampaignLogs/ENGScoring.php', 'SUM', 'ENGScore');
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
function ENGScore($bean, $event, $arguments)
if ($bean->target_type == "Leads" && $bean->activity_type == "link" && $bean->related_type == "CampaignTrackers")
$CampaignTracker = BeanFactory::getBean('CampaignTracker', $bean->related_id);
$TrackerUrl = BeanFactory::getBean('Campaign', $bean->tracker_url);
if ($CampaignTracker && $TrackerUrl === "https://community.sugarcrm.com/community/developer/content?filterID=contentstatus%5Bpublished%5D~category%5Blogic-hooks%5D")
$lead = BeanFactory::getBean('Lead', $bean->target_id);
$lead->eng_sum_c = '55';