Auto populate note / task name with Opportunity name

When creating a note / task from a subpanel in Opportunities, is it possible to pre-populate the name of note / task with the name of the opportunity? This needs to work on mobile as well, so I can't do it in javascript (I don't think at least). If I make the name field a calculated field to be a related($opportunities, "name"), it works after the save. I need the user to be able to see it and change it if necessary. So essentially I need a way to type in the name for the user. Is this possible? I've spent a while trying a few things, nothing has been successful. 

Parents Reply Children
  • custom/Extension/modules/Opportunities/Ext/Vardefs/populate_names_task_notes.php

    <?php

    $dictionary['Opportunity']['fields']['tasks']['populate_list'] = array('name' => 'parents_name_c');
    $dictionary['Opportunity']['fields']['notes']['populate_list'] = array('name' => 'parents_name_c');

    custom/Extension/modules/Notes/Ext/Vardefs/sugarfield_name.php

    <?php


    $dictionary['Note']['fields']['name']['audited'] = false;
    $dictionary['Note']['fields']['name']['massupdate'] = false;
    $dictionary['Note']['fields']['name']['comments'] = 'Name of the note';
    $dictionary['Note']['fields']['name']['importable'] = 'false';
    $dictionary['Note']['fields']['name']['duplicate_merge'] = 'disabled';
    $dictionary['Note']['fields']['name']['duplicate_merge_dom_value'] = 0;
    $dictionary['Note']['fields']['name']['merge_filter'] = 'disabled';
    $dictionary['Note']['fields']['name']['full_text_search'] = array(
    'enabled' => true,
    'boost' => '0.83',
    'searchable' => true,
    );
    $dictionary['Note']['fields']['name']['calculated'] = 'true';
    $dictionary['Note']['fields']['name']['formula'] = '$parents_name_c';
    $dictionary['Note']['fields']['name']['enforced'] = false;

    custom/Extension/modules/Tasks/Ext/Vardefs/sugarfield_name.php

    <?php


    $dictionary['Task']['fields']['name']['audited'] = false;
    $dictionary['Task']['fields']['name']['massupdate'] = false;
    $dictionary['Task']['fields']['name']['importable'] = 'false';
    $dictionary['Task']['fields']['name']['duplicate_merge'] = 'disabled';
    $dictionary['Task']['fields']['name']['duplicate_merge_dom_value'] = 0;
    $dictionary['Task']['fields']['name']['merge_filter'] = 'disabled';
    $dictionary['Task']['fields']['name']['unified_search'] = false;
    $dictionary['Task']['fields']['name']['full_text_search'] = array(
    'enabled' => true,
    'boost' => '1.45',
    'searchable' => true,
    );
    $dictionary['Task']['fields']['name']['calculated'] = 'true';
    $dictionary['Task']['fields']['name']['formula'] = '$parents_name_c';
    $dictionary['Task']['fields']['name']['enforced'] = false;

    custom/modules/Tasks/clients/mobile/views/edit/edit.php

    'fields' =>
       array(
          0 =>
             array(
                'name' => 'parents_name_c',
                'label' => 'LBL_PARENTS_NAME',
                'readonly' => true
             ),

    custom/modules/Notes/clients/mobile/views/edit/edit.php

    'fields' =>
       array(
          0 =>
             array(
                'name' => 'parents_name_c',
                'label' => 'LBL_PARENTS_NAME',
                'readonly' => true,
             ),

    Thanks for your help in this André Lopes

  • Can you confirm if new Task and Note are properly linked to the Opportunity after saving on both Sugar interface and mobile as well?

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Yes, they are properly linked. The related to filed is populated correctly and shows up in the subpanel.

  • André Lopes is there anything else I can try? I feel like we are close.

  • After speaking with sugar, it is a known bug on their end that populate_list isn't working on mobile. As far as I can tell, these are the correct steps for this to work. Thanks for your help.