AnsweredAssumed Answered

logic hook for when a user is assigned to a record

Question asked by Robert Sinclair on Nov 22, 2018
Latest reply on Nov 28, 2018 by Robert Sinclair



I want to trigger an action when a new user gets assigned to a record (by default it's assigned to "admin"). I'm trying the after_relationship_add hook, but it's not working.


Should I even be using the "after_relationship_add" hook at all? It looks like the user, is just a field and is not related to the "user" module... So if we assign a user to a record, is that considered as a relationship adding?



Registered it using:

$hook_array['after_relationship_add'] = Array();
$hook_array['after_relationship_add'][] = Array(
'changes status of inventory unit when a new user gets assigned',

And the hook code is:

class relationship_check_c {
    function relationship_check_c($bean, $event, $arguments) {

        $GLOBALS['log']->info('Executed relationship_check_c logic hook');