How to know if a contact was moved to another account in before save logic hook?

Hi,

We have a logic hook which checks in before save if a contact has been changed. If another account has been selected, certain actions must be performed.

The following code was implemented in the past:

if($bean->account_name !== $bean->fetched_row['account_name'] || $bean->account_id !== $bean->fetched_row['account_id'])

But the fetched_row don't include the fields "account_name" or "account_id" (anymore). So I get warnings in the logs, and the code is not getting executed.

How am I supposed to check this?

Regards,

Stijn

Parents Reply Children
No Data