Kuske, Thanks so much for all your help. I've finally gotten everything working with logic hooks.
These are my files, in case it'll help anyone. It seems to work pretty well!
PHP Code:
<?php
// custom/modules/Leads/logic_hooks.php
// Do not store anything in this file that is not part of the array or the hook version. This file will
// be automatically rebuilt in the future.
$hook_version = 1;
$hook_array = Array();
// position, file, function
$hook_array['before_save'] = Array();
$hook_array['before_save'][] = Array(1, 'UpdateTargetList', 'custom/modules/Leads/UpdateTargetListAutomatically.php', 'UpdateTargetListAutomatically', 'UpdateTargetList');
?>
PHP Code:
<?PHP
class UpdateTargetListAutomatically
{
function UpdateTargetList(&$bean, $event, $arguments="")
{
$listBean = new ProspectList();
$listBean->retrieve('3ab3e58d-b726-33d0-393c-4a90fec10013');
$listBean->load_relationship('leads');
$listBean->leads->add($bean->id); // '8c81cd29-e2b7-661d-e46a-4b999a1eb9f8'
}
}?>
Bookmarks