Hi ,
In lead module how can we create upload document field and dependency drop down (means based on first drop down value second drop drop value should come ).
Thanks
Sandeep
Hi ,
In lead module how can we create upload document field and dependency drop down (means based on first drop down value second drop drop value should come ).
Thanks
Sandeep
Look at the files of the module Notes
as example.
Hi @p.konetskiy,thanks for your valuable reponse ,
Sorry I did not get you ,can we create “choose file” option to upload documents and one more think is ,is it possible to create dependency drop dwon like based on first drop down values the second drop down should show .
could plz help on this two thinks ,this is so helpfull for me .
Thanks
Sandeep
collection files
): Solution for support three new fields types in Studio@p.konetskiy,I am really appriciate you,for your valuable reponse .
How can I do this one ,could you plz help on it ,I am ready to do ,but please exaplain the proccess how can I do,If you have any vide also plz share to me that is so helpfull to me .
Thanks
Sandeep
custom/Extension/modules/<module_name>/Ext/Vardefs/fileupload.php
with the code. (here and next change <module_name>
or <object_name>
to real names.)<?php
$dictionary['<object_name>']['fields']['filename']=array(
'name' => 'filename',
'vname' => 'LBL_FILENAME',
'type' => 'varchar',
'required'=>true,
'importable' => 'required',
'len' => '255',
'studio' => 'false',
);
$dictionary['<object_name>']['fields']['file_ext']=array(
'name' => 'file_ext',
'vname' => 'LBL_FILE_EXTENSION',
'type' => 'varchar',
'len' => 100,
);
$dictionary['<object_name>']['fields']['file_mime_type']=array(
'name' => 'file_mime_type',
'vname' => 'LBL_MIME',
'type' => 'varchar',
'len' => '100',
);
$dictionary['<object_name>']['fields']['uploadfile']=array(
'name'=>'uploadfile',
'vname' => 'LBL_FILE_UPLOAD',
'type' => 'file',
'len' => '255',
'dbType' => 'varchar',
);
custom/Extension/modules/<module_name>/Ext/Language/en_us.fileupload.php
with the code:<?php
$mod_strings['LBL_FILE_UPLOAD'] = 'This is file of the record'; // You can use other text for label
custom/modules/<module_name>/metadata/editviewdefs.php
and custom/modules/<module_name>/metadata/detailviewdefs.php
(if you create it you can copy the file from modules/<module_name>/metadata/editviewdefs.php
and modules/<module_name>/metadata/detailviewdefs.php
). Add some lines:...
array (
'EditView' =>
array (
'templateMeta' =>
array (
'form' =>
array (
'enctype' => 'multipart/form-data', // add the line into the file editviewdefs.php only
...
'panels' =>
array (
'lbl_...' =>
array (
...
/* add the array */
1 =>
array (
'name' => 'uploadfile',
),
...
modules/<module_name>/<object_name>.php
and add the function to object (for example modules/Accounts/Account.php
): function deleteAttachment($isduplicate="false")
{
if($this->ACLAccess('edit'))
{
if($isduplicate=="true")
{
return true;
}
$removeFile = "upload://{$this->id}";
}
if(file_exists($removeFile))
{
if(!unlink($removeFile))
{
$GLOBALS['log']->error("*** Could not unlink() file: [ {$removeFile} ]");
}
else
{
$this->uploadfile = '';
$this->filename = '';
$this->file_mime_type = '';
$this->file = '';
$this->save();
return true;
}
}
else
{
$this->uploadfile = '';
$this->file_mime_type = '';
$this->file = '';
$this->save();
return true;
}
return false;
}
Notes:
modules/<module_name>/<object_name>.php
will not supported by upgrade SuiteCRM. After upgrade you should repair the code.Great solution!
These core files can be overridden in an upgrade-safe way, here is an example:
@pgr
Yes! I thought that this was very many for one time.
Excellent article u wrote. Great. Its works nice.