Hey!
Im working on this logic hook within the Accounts Module, on an after_save. I have a custom module built, and i need to update a row with the custom module table when an account field switches to active. Running Suite 6.5
$hook_array['after_save'][] = Array(1, 'Update School Record', 'custom/modules/Accounts/customschoollogichook.php','SchoolUpdate', 'UpdateSchoolField');
class SchoolUpdate
{
function UpdateSchoolField ( $bean, $event, $args ){
if ($bean->account_status_c == 'Active Account' && !empty($bean->fetched_row) && $bean->fetched_row['account_status_c'] <> $bean->account_status_c) {
global $db;
$accountID = $bean->id;
$sourceLead = $db->fetchOne("SELECT id FROM leads where account_id = '{$accountID}'");
if (!empty($sourceLead)) {
$db->query("UPDATE schools SET account_id1_c = '{$accountID}' where lead_id_c = '{$sourceLead}'");
Did confirm the logic hook is getting hit but the queries are not executing.
Thanks!!!