I have a field in my account (Name of the Main responsible person) and i want to sync this Field down the a specific call under the account which is planned.
My Idea: I will try to use the workflow module and start the routine if a call is safed and a psecific checkbox in the call module is checked. The Problem: It is not working to sync the Data from the account field to the call field.
I’ve been having a look and I’m not sure if its possible to modify a record in that manner through Workflow
(ie: Fire on a Child, and set a value to match a parent record’s)
Though its definitely possible through logic hooks!
I’ve managed to get a simple hook going that updates the Call’s Assigned user to match the Account’s, which sounds like it’s close to what you’d like to achieve
If you’d like to get it going through Logic Hooks, you could do the following:
Create a new file at:
/custom/Extensions/modules/Calls/Ext/Logichooks/
(if this directory does not exist, feel free to create it)
(Feel free to rename any files/functions/classes )
Then, in the location specified in the Logic Hook line created above, create a file with the same name
(ie: in custom/modules/Calls/ location, i created ‘assignee.php’)
In this file, I added:
<?php
class assigneeC{
public function assigneeF(SugarBean $bean, $event, $arguments){
if ($bean->parent_type == "Accounts" && $bean->checkme_c==true){
$accountBean = BeanFactory::getBean($bean->parent_type,$bean->parent_id);
$bean->assigned_user_id = $accountBean->assigned_user_id;
}
}
}
So, the above snippet will check that the Call is associated with an Account, as well as checking that a checkbox is checked.
(Feel free to rename “checkme_c” to the name of the checkbox you’d like to check)
Then, it will update the Call’s “Assigned to” value to match the related Account’s “Assigned to” value
The above should be modifiable to closer meet your goal, but let me know if you've got any questions!
More info on Logic Hooks can be found here: