Has anyone managed to create multiple Flex Relate Fields in a form?
I got round the issue by adding the fields to vardefs
'activity_type' => array (
'name' => 'activity_type',
'vname' => 'LBL_ACTIVITY_NAME',
'type' => 'parent_type',
'dbType' => 'varchar',
'group' => 'activity_name',
'required' => false,
'reportable' => false,
'len' => '25',
'comment' => 'The Sugar object to which the call is related'
),
'activity_name' => array (
'name' => 'activity_name',
'activity_type' => 'record_type_display',
'type_name' => 'activity_type',
'id_name' => 'activity_id',
'vname' => 'LBL_ACTIVITY',
'type' => 'parent',
'group' => 'activity_name',
'source' => 'non-db',
'options' => 'zz_exp_activity_type',
'required' => true,
'studio' => 'visible'
),
'activity_id' => array (
'required' => true,
'name' => 'activity_id',
'type' => 'id',
'group' => 'activity_name',
'reportable' => false,
'vname' => 'LBL_ACTIVITY_ID',
'studio' => 'visible',
),
It then works properly in EdiView but not in DetailView
I added the following to view.details.php to fix the issue:
//activity
if ($this->bean->activity_id){
$a = new $this->bean->activity_type;
$a->Retrieve($this->bean->activity_id);
$this->bean->activity_name = $a->name;
}
Has anyone got a better solution?