Hi.
I need to add a file field in an existing custom module, so i tried made some custom code in flie ‘/suitecrm/custom/Extension/modules/mymodule/Ext/Vardefs/mymodulefile.php’:
$dictionary["mymodule"]["fields"]["file_mime_type"] = array (
'name' => 'file_mime_type',
'vname' => 'LBL_FILE_MIME_TYPE',
'type' => 'varchar',
'len' => '100',
'importable' => false,
);
$dictionary["mymodule"]["fields"]["file_url"] = array (
'name'=>'file_url',
'vname' => 'LBL_FILE_URL',
'type'=>'function',
'function_require' => 'include/upload_file.php',
'function_class'=>'UploadFile',
'function_name'=>'get_url',
'function_params'=> array(
0 => 'filename',
1 => 'id',),
'source'=>'function',
'reportable'=>false,
'importable' => false,
);
$dictionary["mymodule"]["fields"]["filename"] = array(
'name' => 'filename',
'vname' => 'LBL_FILENAME',
'type' => 'file',
'dbType' => 'varchar',
'len' => '255',
'reportable'=>true,
'importable' => false,
);
I can see now the file field in studio and can add it to the views.
The problem is that in edit view i can browse and add the file but in detail view i cannot see the file link to open it, it seems it doesn upload after all