Hi,
I have a related field to users in Leads and i need to change its value in a logic hook "after save", i'm doing it this ways :
1) $bean->custom_related_field = $bean->assigned_user_name;
2) $bean->telemarketer_c = $bean->assigned_user_id;
then :$bean->save();
But none it's working, can you please help me.
This excerpt from one of my older blog posts may help:
For scenarios where an after_save hook is being used, the custom fields must be reloaded. Without reloading them, a line of code such as $bean->my_custom_field_c would not work, either for read or write purposes. So how do we reload the custom fields? It is rather simple.
To solve this problem, simply add the following code prior to any code intended to access a custom field:
$bean->custom_fields->retrieve();
The full post is here, if interested:
Angel's Blog: Logic Hooks: Odds and Ends