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

StackOverflow https://stackoverflow.com/questions/4196257

  •  11-10-2019
  •  | 
  •  

Question

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?

Was it helpful?

Solution

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top