Has populate_list stopped working for quotes in 7.10?

We had a pretty simple customization in 7.8 that was populate a phone number and email field when a contact relate field was populated in quotes. After upgrading to 7.10 it no longer works. 

We were adding the following to the vardef

$dictionary['Quote']['fields']['customer_name_c']['populate_list'][0] = 'name';
$dictionary['Quote']['fields']['customer_name_c']['populate_list'][1] = 'id';
$dictionary['Quote']['fields']['customer_name_c']['populate_list'][2] = 'phone_work';
$dictionary['Quote']['fields']['customer_name_c']['populate_list'][3] = 'email1';
$dictionary['Quote']['fields']['customer_name_c']['field_list'][0] = 'customer_name_c';
$dictionary['Quote']['fields']['customer_name_c']['field_list'][1] = 'contact_id_c';
$dictionary['Quote']['fields']['customer_name_c']['field_list'][2] = 'cust_phone_number_c';
$dictionary['Quote']['fields']['customer_name_c']['field_list'][3] = 'email_c';

Worked in 7.8 no worky in 7.10

I can extend the js controller to do this but seems like we're moving backwards if this no longer works. 

Thanks for any help,

-pat

Parents
  • Eventually you have to set the attribute 'auto_populate':

    $dictionary['Quote']['fields']['customer_name_c']['auto_populate'] = true;

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • I added a relate contact field my_contact_c/contact_id_c and a phone field my_contact_phone_c to accounts.

    Then I created custom/Extension/modules/Accounts/Ext/Vardes/my_contact.php with following content:

    <?php
    $dictionary['Account']['fields']['my_contact_c']['auto_populate'] = true;
    $dictionary['Account']['fields']['my_contact_c']['populate_list'] = array(
    // source => target,
    'name' => 'my_contact_c',
    'id' => 'contact_id_c',
    'phone_work' => 'my_contact_phone_c',
    );
    ?>

    After clearing the cache and QR&R I could select a contact in an Account and teh field my_contact_phone_c was filled automatically.

    Thanks to Francesca Shiekh for the right direction!

    Harald Kuske
    Principal Solution Architect – Professional Services, EMEA
    hkuske@sugarcrm.com
    SugarCRM Deutschland GmbH

  • Hey guys, I'm facing same issue. I have create custom module and create 1 - Many (1-custom_module to Many Quotes). I tried this solution but its not working. I'm using sugarcrm 8.3

    This is my code.

    $dictionary["Quote"]["fields"]["avds_families_quotes_1_name"] = array (
    'auto_populate' => true,
    'populate_list' => array(
    'avds_families_quotes_1_name' => 'avds_families_quotes_1avds_families_ida',
    )
    );

  • This doesn't look right: 

    'avds_families_quotes_1_name' => 'avds_families_quotes_1avds_families_ida',

    It looks like you're trying to copy a name field over to an id field both of which are part of the relationship. The populate_list array should contain field mappings from the source module to the target module. Kinda like this:

    $dictionary["Quote"]["fields"]["avds_families_quotes_1_name"]['auto_populate'] = true;

    $dictionary["Quote"]["fields"]["avds_families_quotes_1_name"]['populate_list'] = array(

       'field_from_custom_module_1' => 'field_in_quotes_to_copy_to_1',

       'field_from_custom_module_2' => 'field_in_quotes_to_copy_to_2',

       'field_from_custom_module_3' => 'field_in_quotes_to_copy_to_3',

    );

    The fields on the left are the source fields in the custom module and the fields on the right are the target fields in the Quotes module. Then the fields will be copied over whenever the avds_families_quotes_1_name field changes. 

     

    The way you show above actually completely overwrites everything else in the $dictionary["Quote"]["fields"]["avds_families_quotes_1_name"]  array and the rest of the vardef for the avds_families_quotes_1_name field would be lost. 

     

    -pat

  • HI Pat, 

    Thanks for reply.

    as you suggest I did -

    $dictionary["Quote"]["fields"]["avds_families_quotes_1_name"] = array (
    'auto_populate' => true,
    'populate_list' => array(
    'name' => 'avds_families_quotes_1_name',
    ),
    );

    but still it is not working.

Reply Children