How can add flex relate field to subpanel

I have added a flex relate field to a subpanel using studio Parent TypeThe field parent_name does not populate with studio. But I have put below code :

'parent_name' => 

  array (
    'type' => 'parent',
    'studio' => 'visible',
    'vname' => 'LBL_PARENT',
    'link' => true,
    'sortable' => false,
    'ACLTag' => 'PARENT',
    'dynamic_module' => 'PARENT_TYPE',
    'id' => 'PARENT_ID',
    'related_fields' =>
    array (
      0 => 'parent_id',
      1 => 'parent_type',
    ),
    'width' => '10%',
    'default' => true,
    'widget_class' => 'SubPanelDetailViewLink',
    'target_module' => NULL,
    'target_record_key' => 'parent_id',
  ),But it did not populated with subpanel.

How can I fix this?
Thanks
  • I have written logic hook process_record. I have added no-db field(sub_parent_name) display with flex relate field.

    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    class CLS_FlexRelatefielddis {

        function fn_FlexRelatefielddis(&$focus, $event, $arguments){
           
            if($event == 'process_record' && $_REQUEST['return_module'] == 'Quick2Email' && !empty($focus->parent_id))
            {
                $beanParent = BeanFactory::getBean($focus->parent_type);
                $beanParent->retrieve($focus->parent_id);
                if(!empty($beanParent->id))
                {
                $focus->sub_parent_name = '<a href="./index.php?module='.$focus->parent_type.'&action=DetailView&record='.$focus->parent_id.'">'.$beanParent->name.'</a>';
                }
            }
        }
    }
    ?>