unrelate function on Hook has no effect
Collapse
X
-
if you have the latest version you might try this code below:
PHP Code:$entityManager->getRDBRepository('Account')
->getRelation($account, 'opportunities')
->unrelateById($opportunityId);
-
unrelate function on Hook has no effect
Hi,
Following directions from https://docs.espocrm.com/development/orm/, I do unrelate as follows in a Hook :
PHP Code:$entityManager
->getRDBRepository('Account')
->getRelation($account, 'opportunities')
->unrelate($opportunity);
PHP Code:$opportunityCollection = $entityManager
->getRDBRepository('Account')
->getRelation($account, 'opportunities')
->limit(0, 10)
->find();
If I unrelate from frontend GUI in bottom panel, it works fine. But when I unrelate in backend as above, it does not work. Every other statement executed at the same time in my Hook are done properly. I don't have any error logged in backend logs nor in console.
Any help on what direction to search would be highly appreciated as I'm kind of stuck with this issue.
Thanks !Last edited by huscmk; 12-02-2023, 09:42 AM.Tags: None
Leave a comment: