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.
- 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', ),
- 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. - 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.