Can i ensure all Contacts under an Account automatically get assigned to the Account's Assigned To/User?

Hi Team,

When you create Contacts from an Account (record) by using the + button, the contacts are automatically assigned to whoever is adding it. I would like to know if you guys know of any way that we can ensure they are Assigned to the Assigned user of the Account?

Thanks,

Parents
  • With a variety of different approaches here I would like to add my own.

    I implemented this by leveraging the SetValue from the dependency actions framework. 

    This was my code for the Opportunities module, you just need to adapt it to use in a different module. 

    custom/Extension/modules/Opportunities/Ext/Dependencies/inherit_account_assigned_to.php

    <?php
    
    $dependencies['Opportunities']['populate_assigned_user'] = array(
        'hooks' => array("edit"),
        'trigger' => 'greaterThan(strlen(related($accounts,"assigned_user_name")),0)', 
        'onload' => 'true', 
        'actions' => array(
            array(
                'name' => 'SetValue',
                'params' => array(
                    'target' => 'assigned_user_id',
                    'value' => 'related($accounts,"assigned_user_id")'
    
                )
    	),
    	array(
                'name' => 'SetValue',
                'params' => array(
                    'target' => 'assigned_user_name',
                    'value' => 'related($accounts,"assigned_user_name")'
    
                )
            )
        )
    );


Reply
  • With a variety of different approaches here I would like to add my own.

    I implemented this by leveraging the SetValue from the dependency actions framework. 

    This was my code for the Opportunities module, you just need to adapt it to use in a different module. 

    custom/Extension/modules/Opportunities/Ext/Dependencies/inherit_account_assigned_to.php

    <?php
    
    $dependencies['Opportunities']['populate_assigned_user'] = array(
        'hooks' => array("edit"),
        'trigger' => 'greaterThan(strlen(related($accounts,"assigned_user_name")),0)', 
        'onload' => 'true', 
        'actions' => array(
            array(
                'name' => 'SetValue',
                'params' => array(
                    'target' => 'assigned_user_id',
                    'value' => 'related($accounts,"assigned_user_id")'
    
                )
    	),
    	array(
                'name' => 'SetValue',
                'params' => array(
                    'target' => 'assigned_user_name',
                    'value' => 'related($accounts,"assigned_user_name")'
    
                )
            )
        )
    );


Children
No Data