Display ‘Add to Target List’ for custom module on SugarCRM 7

Promise Ekoriko


We wrote recently about customising your custom module for Campaigns in our post ‘Using SugarCRMs campaign module with a custom module‘. This post will allow you to display the ‘Add To Target List’ on the list view drop down on SugarCRM 7.

To begin, follow the steps detailed in our previous blog post. If you already have, you can begin customising straight away.

  1. Add the field descriptor for the new button. Open ./modules/modulename/clients/base/views/recordlist/recordlists.php
    array(                 'name' => 'addtolist_button',                 'type' => 'button',                 'label' => 'LBL_ADD_TO_PROSPECT_LIST_BUTTON_LABEL',                 'primary' => true,                 'events' => array(                     'click' => 'list:massaddtolist:fire',                 ),                 'acl_module' => 'ProspectLists',                 'acl_action' => 'edit',             ), 
  2. Add a new field to load the target lists. Open ./modules/modulename/vardefs.php. Under the fields array, add:
    'prospect_lists_name' => array(             'name' => 'prospect_lists_name',             'type' => 'link',             'relationship' => 'prospectlists_modulename_1',             'module' => 'ProspectLists',             'source' => 'non-db',             'vname' => 'LBL_PROSPECT_LIST',         ),

    Replace prospectslists_modulename_1 with the name of the relationship between your module and Target Lists module.

  3. Run Quick Repair and you should be able to add a selection of records from your custom module to a target lists.

For SugarCRM consulting, use our contact form or request a call back.


Leave a Reply

More great articles


Using SugarCRMs campaign module with a custom module.

This post will show you an easy and sure fire way to get your custom person module working with SugarCRMs campaign…

Read Story

Never miss a minute

Get great content to your inbox every week. No spam.
Only great content, we don’t share your email with third parties.