Hello
I created a custom module using the studio and want to trigger an action when a user gets assigned to a record. I’m trying the after_relationship_add hook, but it’s not working.
May be because it’s a custom module it’s causing problems? Shouldn’t be the case since the relationship between users and this module is there by default
Here’s the code to register the hook
$hook_array['after_relationship_add'] = Array();
$hook_array['after_relationship_add'][] = Array(
77,
'changes status of inventory unit when a new user gets assigned',
'custom/inventory/relationship_check_c.php',
'relationship_check_c',
'relationship_check_c');
and the actual hook
class relationship_check_c {
function relationship_check_c($bean, $event, $arguments) {
$GLOBALS['log']->info('Executed relationship_check_c logic hook');
}
}
Figured it out… User getting assigned to a record != relationship add. When we change the user we just change a field value for the bean, no relationship between records is created