Monday, 10 June 2013

Calls subpanel under Task module

Greetings from Urdhva Tech!

Yet another interesting forum post led me dive into code base!

Aim: Calls subpanel under Task module.

2 files makes difference!

Step 1:  Create extended vardef for Tasks module > custom/Extension/modules/Tasks/Ext/Vardefs/calls_subpanel.php add following code in it.

$dictionary['Task']['fields']['calls'] = array(
'name' => 'calls',
'type' => 'link',
'relationship' => 'tasks_calls',
'module' => 'Calls',
'bean_name' => 'Call',
'source' => 'non-db',
'vname' => 'LBL_CALLS',

$dictionary['Task']['relationships']['tasks_calls'] = array('lhs_module' => 'Tasks''lhs_table' => 'tasks''lhs_key' => 'id',
'rhs_module' => 'Calls''rhs_table' => 'calls''rhs_key' => 'parent_id',
'relationship_type' => 'one-to-many''relationship_role_column' => 'parent_type',
'relationship_role_column_value' => 'Tasks'); 

Step 2: Create a file under > custom/Extension/modules/Tasks/Ext/Layoutdefs/calls_subpanel.php
and add following code.

$layout_defs['Tasks']['subpanel_setup']['calls'] = array(
'order' => 10,
'module' => 'Calls',
'title_key' => 'LBL_CALLS',
'subpanel_name' => 'default',
'get_subpanel_data' => 'calls',
'top_buttons' => array(
'widget_class' => 'SubPanelTopCreateButton'),

Quick Repair and Rebuild!


Comments are welcome!

Follow us on Twitter @urdhvatech

Glimpse of our plug-ins & products.

No comments:

Post a Comment

Post a Comment

Urdhva Tech Pvt. Ltd. Powered by Blogger.

Urdhva Tech

My Photo
SugarCRM Consultants Contact us at Skype : urdhvatech

Search This Blog


Stay connected Socially


Total Pageviews

Popular Posts