Image Field Type

If SuiteCRM is a fork of SugarCRM, how come there is not a field type for an image like there is in SugarCRM Pro?

Hi smudley,

yah suitecrm is fork of sugarcrm. here also you can use field type for an image .

and yah if you are talking about image file upload there is solution for that.

for this You have to use file type.

you have to add this particular code in custom//metadata/editviewdefs.php

'templateMeta' => 
     array (
      'form' => 
      array (
         'enctype' => 'multipart/form-data',     //you have to add this thing in ur code.
      ),

and create vardefs in in module file vardefs.php

add this code,

 'file_mime_type' =>
  array (
    'name' => 'file_mime_type',
    'vname' => 'LBL_FILE_MIME_TYPE',
    'type' => 'varchar',
    'len' => '100',
    'comment' => 'Attachment MIME type',
    'importable' => false,
  ),
  'file_url'=>
  array(
    'name'=>'file_url',
    'vname' => 'LBL_FILE_URL',
    'type'=>'function',
    'function_class'=>'UploadFile',
    'function_name'=>'get_upload_url',
    'function_params'=> array('$this'),
    'source'=>'function',
    'reportable'=>false,
    'comment' => 'Path to file (can be URL)',
    'importable' => false,
    ),
  'filename' =>
  array (
    'name' => 'filename',
    'vname' => 'LBL_FILENAME',
    'type' => 'file',
    'dbType' => 'varchar',
    'len' => '255',
    'reportable'=>true,
    'comment' => 'File name associated with the note (attachment)',
    'importable' => false,
  ),

Now go again to editviewdefs.php in custom folder,

add this where ever you want, in the layout,


5 => 
        array (
          0 => 
          array (
            'name' => 'filename',
            'comment' => 'File name associated with the note (attachment)',
            'label' => 'LBL_FILENAME',
          ),
        ),
1 Like

SuiteCRM is a fork of SugarCRM Community Edition, not the licensed versions(Enterprise/Professional/Ultimate).

Thanks,

Will.