AnsweredAssumed Answered

Logic hook does not appear to be triggering

Question asked by Joana Lopes da Fonseca on Mar 21, 2014
Latest reply on Jul 27, 2015 by Sumit Sahay
Hello,

i'm trying to add a Logic Hook to Community Edition version 6.5.16. 
It's a very simple logic hook, it should look to two fields and in another field put the sum of the two fields. The problem is that the answer field stays empty :\

logic_hook.php (custom/modules/Accounts)
<?php
    $hook_version = 1;
    $hook_array = Array();

    $hook_array['after_save'] = Array();
    $hook_array['after_save'][] = Array(1, 'after_save example', 'custom/modules/Accounts/Accounts_hook.php', 'Accounts_hook_class',  'Accounts_hook_method');
?>

Accounts_hook.php (custom/modules/Accounts/Accounts_hook.php)

<?php
   
    class Accounts_hook_class
    {
        function Accounts_hook_method(&$bean, $event, $arguments,$focus)
        {

   $dias_3_c = $bean->dias3_c;
   $dias_4_c = $bean->dias4_c;
   $aux = $dias_3_c + $dias_4_c;
   $bean->dias2_c = $aux;
        }
    }

?>



Does anyone could help me with this problem?

Thanks,

Joana Lopes da Fonseca

Outcomes