In SugarCRM, transferring account ownership to another user does not update contact property

I use SugarCRM v6.x and found that when transferring ownership of an account to a new sales representative (field assign_user_id), contacts and other related child records are also not transferred.

  • Is this the actual design choice by SugarCRM, and if so, what is the reason for this?

  • Is there a recommended method for migrating accounts that also transfer ownership of related child accounts?

+3
source share
1 answer

I would do it with logical hooks.

  • Create the hooks.php logic 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 a .php file 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
        }
    }
    ?>
    

. - ( SugarCRM 6.1).

+5

Source: https://habr.com/ru/post/1775226/


All Articles