I had to replace text field ‘interested_c’ with ‘eng_sum_c’ which is decimal type and would store numeric values.
I now need to create a logic hook which if possibly, could use both pieces of information as conditions on each occurance of:
if Activity Type = " link" (Click-thru Link) (link) and other ‘related’ = (or tracker_id),
then the incremental value is added to custom field ‘eng_sum_c’.
Only things I could figure out is by now are:
This ‘Campaign’ Subpanel is getting most data from module: CampaignLog (which has a relationship with Campaign). [Corresponding MySQL Table: campaign_log]
These variables are defined in vardefs.php of suitecrm>modules>CampaignLog> Vardefs of the fields concerned here
There is no directly relationship of any kind between ‘Campaignlog’ and ‘Leads’. However, CampaingLog does have a relationship with Campaign module.
My current status is that I am not able to make sense of anything of all these scattered pieces of information.
My logic_hook.php is
$hook_version = 1;
$hook_array = Array();
// position, file, function
$hook_array['after_relationship_add'] = Array();
$hook_array['after_relationship_add'] = Array(1, 'Engagement Scoring via CampaignLogs', 'custom/modules/CampaignLogs/ENGScoring.php', 'SUM', 'ENGScore');
My ENGScoring.php is not making sense to me even.
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
function ENGScore($bean, $event, $arguments)
if ($arguments['related_module'] =='Campaign')
$leadsBean = BeanFactory::getBean('CampaignLog', $arguments['target_id']);
if ($bean->activity_type == "link")
// && $campaignBean->refer_url == "https://github.com/salesagility/SuiteCRM/pull/2454/commits/1a09fd2cffde60533c0fd03d1f33cfcc8e1e7105")
$lead_Bean->eng_sum_c = '55';
Please help in building this logic hook definition and underlying logic.