Hey guys, Since I have updated to from version 7.11.19-1 to 7.12.2, i have been
experiencing some errors.
Everything started from here: Workflow. Send email. Custom module
I worked out by creatin a module logic hook that copies account email on custom-module email. Like this:
I have created this file: /bitnami/suitecrm/custom/modules/seg_Polizas/Logic_Hooks-php
$hook_array['after_save'][] = Array(
78,
'agregarVencimientos',
'custom/modules/seg_Polizas/despues_de_guardar_hook/after_save_hook.php',
'after_save_hook',
'setEmailDeCuenta');
And then created this file:
/bitnami/suitecrm/custom/modules/seg_Polizas/despues_de_guardar_hook/after_save_hook.php
<?php
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class after_save_hook
{
function setEmailDeCuenta($bean, $event, $arguments)
{
$account = new Account(); // So this links $account to the Accounts module?
$account->retrieve($bean->account_id_c); // This is the label of the field in Accounts that has the account name - which is what we search for in Cases when creating a new case, so once this account is selected, the below should be filled in?
// $bean is your current record being saved.
// $account is the related account.
$bean->email_notificaciones = $account->email1; // These are the field in Accounts that I want to be shown in Cases once the Account has been selected (before saving the case)
}
}
?>
When i add a new poliza (custom module) the email field isnt copied from de account info.
Nothing displayed on the log file.
Could it be a permission issue? Any Help is very welcome!
Thanks