AnsweredAssumed Answered

Creating Calls from subpanel takes parent_name as Contact name instead of Call Subject

Question asked by Mukta Patel on Oct 29, 2014
Latest reply on Oct 30, 2014 by Mukta Patel
I have a custom module that actually stores all activities (calls,meetings,emails and tasks) so that we can create report from a single module.

When I create a task or other activity from edit view it stores it properly however whenever I do the same from subpanel it actually stores parent record
Eg : If I create task named "Sales Meeting" from Contact named "John Cena" it stores contact name instead of task subject.

Actually the parent_id and parent_type are stored of Contacts module .

Below is my vardef definition

$dictionary['user_activity']['fields']['parent_name'] = array(
'name'=> 'parent_name',
    'parent_type'=>'record_type_display' ,
    'type_name'=>'parent_type',
    'id_name'=>'parent_id',
    'vname'=>'LBL_FLEX_RELATE',
    'type'=>'parent',
'group'=>'parent_name',
    'source'=>'non-db',
    'options'=> 'parent_type_display',
);
 
$dictionary['user_activity']['fields']['parent_type'] = array(
'name'=>'parent_type',
      'vname'=>'LBL_PARENT_TYPE',
    'type' => 'parent_type',
    'dbType'=>'varchar',
      'group'=>'parent_name',
    'options'=> 'parent_type_display',
      'required'=>false,
    'len'=>'255',
    'comment' => 'The Sugar object to which the call is related',
    'options' => 'parent_type_display',
);


 
$dictionary['user_activity']['fields']['parent_id'] = array(
  'name' => 'parent_id',
    'type' => 'id',
    'group'=>'parent_name',
    'reportable'=>false,
    'vname'=>'LBL_PARENT_ID',
    'comment' => 'The ID of the parent Sugar object identified by parent_type'
);
 

$dictionary['user_activity']['fields']['contacts'] = array(
'name' => 'contacts',
'type' => 'link',
'relationship' => 'user_activity_contacts',
'module'=>'Contacts',
'bean_name'=>'Contact',
'source'=>'non-db',
'vname'=>'LBL_CONTACTS',
);

$dictionary['user_activity']['relationships']['user_activity_contacts'] = array(
'rhs_module'    => 'user_activity',
'rhs_table'    => 'user_activity',
'rhs_key'    => 'parent_id',
'lhs_module'    => 'Contacts',
'lhs_table'    => 'contacts',
'lhs_key'    => 'id',
'relationship_type'    => 'one-to-many',
'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'Contacts'
);

Outcomes