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

  • 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
  • Hmmm.... I don't remember ever including that before. And still doesn't work. Below is the full vardef from cache/modules/Quotes/Quotevardefs.php. Another strange side effect is that it does put the name value from the Contact into the name of Quote. See image below. No Customer Email, not Customer Phone Number but the Customer Name becomes the Quote Subject. 

        'customer_name_c' => 
        array (
          'labelValue' => 'Customer',
          'dependency' => '',
          'populate_list' =>
          array (
            0 => 'name',
            1 => 'id',
            2 => 'phone_work',
            3 => 'email1',
          ),
          'field_list' =>
          array (
            0 => 'customer_name_c',
            1 => 'contact_id_c',
            2 => 'cust_phone_number_c',
            3 => 'email_c',
          ),
          'auto_populate' => true,
          'required' => true,
          'source' => 'non-db',
          'name' => 'customer_name_c',
          'vname' => 'LBL_CUSTOMER_NAME',
          'type' => 'relate',
          'massupdate' => false,
          'no_default' => false,
          'comments' => '',
          'help' => '',
          'importable' => 'true',
          'duplicate_merge' => 'disabled',
          'duplicate_merge_dom_value' => 0,
          'audited' => false,
          'reportable' => true,
          'unified_search' => false,
          'merge_filter' => 'disabled',
          'calculated' => false,
          'len' => 255,
          'size' => '20',
          'id_name' => 'contact_id_c',
          'ext2' => 'Contacts',
          'module' => 'Contacts',
          'rname' => 'name',
          'quicksearch' => 'enabled',
          'studio' => 'visible',
          'id' => 'Quotescustomer_name_c',
          'custom_module' => 'Quotes',
        ),
  • Could it be a syntax issue?

    This is working for me in 7.9.2, note that the entry is named, not numbered. I've not yet installed 7.10.x

    $dictionary['Product']['fields']['product_template_name']['populate_list']['platforms_available_c'] = 'platforms_available_c';

     

    FrancescaS

  • 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

  • I was recently shown this method and it did work for me. I had been using populate_list and field_list as show both 

    here: SugarCRM: Populating fields using a Relate field « Sugar Developer Blog – SugarCRM 

    and here: HOWTO: Using a relate field to populate a custom field « Sugar Developer Blog – SugarCRM 

    Both old articles but that method had been working for me until 7.9. 

    Thanks to everyone for their help. 

    -pat

  • Hi Pat Pawlowski,

    both articles you found were designed for Sugar 6. They work in certain modules an certain versions of Sugar 7 too.

    The method I described is part of the developer guide for version 7.10, you should be able to use it in Sugar 7.

    Harald

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

  • Interesting that going to the developer guide http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.10/ and searching for populate_list returns a single listing relating to 6.5 named "Adding QuickSearch to a custom field." You would think that would pretty specific. 

    Thanks again,

    -pat

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