<div dir="ltr">Hi,<div><br></div><div>Thanks! for providing the information :) </div><div><br></div><div>The above given information will implies for all modules. What i mean in previous thread is, when calendar edit-view is displayed there you need to debug and check what is the field-model that's been generated for custom field.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 28, 2015 at 1:38 PM, apcloic <span dir="ltr"><<a href="mailto:apcloic@gmail.com" target="_blank">apcloic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Uma,<br>
<br>
Here's the model field :<br>
<br>
        /**<br>
         * Function to get the Template name for the current UI Type object<br>
         * @return <String> - Template Name<br>
         */<br>
        public function getTemplateName() {<br>
                return 'uitypes/FileField.tpl';<br>
        }<br>
<br>
        /**<br>
         * Function to get the Display Value, for the current field type with given<br>
DB Insert Value<br>
         * @param <String> $value<br>
         * @param <Integer> $recordId<br>
         * @param <Vtiger_Record_Model><br>
         * @return <String><br>
         */<br>
        public function getDisplayValue($value, $recordId, $recordModel = false) {<br>
                $moduleName = $this->get('field')->getModule()->getName();<br>
                if(!$recordModel) {<br>
                        $recordModel = Vtiger_Record_Model::getInstanceById($recordId,<br>
$moduleName);<br>
                }<br>
<br>
                if($recordModel) {<br>
                        if(!empty($value)) {<br>
                                $db = PearDatabase::getInstance();<br>
                                $fileIdRes = $db->pquery('SELECT <a href="http://vtiger_attachments.name" target="_blank">vtiger_attachments.name</a> FROM<br>
vtiger_attachments<br>
                                                                WHERE vtiger_attachments.attachmentsid=?', array($value));<br>
                                //$fileId = $db->query_result($fileIdRes, 0, 'attachmentsid');<br>
                                //if($fileId){<br>
                                        $value = ' '.$db->query_result($fileIdRes, 0, 'name').'<br>
<index.php?module='.$moduleName.'&action=DownloadFile&record='.$recordId.'&fileid='.$value.'><br>
';<br>
                                //}<br>
                        }<br>
                }<br>
                return $value;<br>
<br>
File.php <<a href="http://vtiger-crm.2324883.n4.nabble.com/file/n15057/File.php" target="_blank">http://vtiger-crm.2324883.n4.nabble.com/file/n15057/File.php</a>><br>
<br>
Thanks ;)<br>
Regards,<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtiger-crm.2324883.n4.nabble.com/Custom-UItype-upload-file-field-working-well-except-on-Calendar-Events-tp15047p15057.html" target="_blank">http://vtiger-crm.2324883.n4.nabble.com/Custom-UItype-upload-file-field-working-well-except-on-Calendar-Events-tp15047p15057.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the vtigercrm-developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">With<br>Best Regards<br>Uma.S<br><div>Vtiger Team</div></div></div>
</div>