In SugarCRM, transferring account ownership to another user doesn't update contact ownership

Deadly 提交于 2019-12-14 01:27:20

问题


I am using SugarCRM v6.x and have discovered that when transferring account ownership to a new sales rep (the assigned_user_id field) the contacts and other related child records do not get transferred as well.

  1. Is this an actual design choice by the SugarCRM authors, and if so, what is the reason behind it?

  2. Is there a recommended method of transferring accounts that will transfer ownership of related child records as well?


回答1:


I would make it using logic hooks.

  • Create a logic_hooks.php in custom/modules/myModule/

    <?
    $hook_array = Array(); 
    $hook_array['after_save'] = Array(); 
    $hook_array['after_save'][] = Array(0, 'myName', 'custom/modules/myModule/logic_hooks/file.php','myClass', 'myMethod');   
    ?>
    
  • Create file.php in /custom/modules/myModule/logic_hooks/

    <?php
    class myClass{
        function myMethod(&$bean, $event, $arguments){
            // Do something with $bean (like load related contacts and update their assigned user
        }
    }
    ?>
    

For more info see Business Logic Hooks (SugarCRM 6.1 Developer Guide).



来源:https://stackoverflow.com/questions/4196257/in-sugarcrm-transferring-account-ownership-to-another-user-doesnt-update-conta

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!