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: