SugarCRM:如何通过钩子逻辑删除帐户和联系人关系

SugarCRM: How to remove account & contact relationship through hook logic

我有以下代码来删除帐户和联系人之间的关系,但它不起作用:

$bean->accounts->delete("account id here");

有没有人有通过逻辑挂钩删除客户和联系人关系的工作示例?

试试这个;

$contact->load_relationship("accounts");
$contact->accounts->delete($contact->id, $account->id);

有关更多可用功能,请参阅 /data/Link2。php。