<div dir="ltr">Alan,<div><br></div><div>vtiger_notes has document information, if it is related to a internal file then its filelocationtype is set "I" which means internal. This document will have a file relation stored in seattachmentsrel table, to get the actual detail of file like name, path, size etc you need to look into attachments table. If a Contact/Lead etc is related to a Document then we store the info into senotes table, so you need to first query the senotes table to get the related documents then join notes table with seattachments and attachments table to get the file information. Let me know if this helps. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 December 2014 at 20:03, Alan Lord <span dir="ltr"><<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 01/12/14 14:13, Lajeesh wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Think vtiger_notes is the table for document module and<br>
vtiger_attachments is for file attachments<br>
</blockquote>
<br></span>
Yes but both vtiger_notes and vtiger_attachments contain attachment data (filename, path etc...).<br>
<br>
It's quite confusing regarding the ids used and which tables are used under which circumstances; along with notes and attachments tables there are also the seattachmentsrel and senotesrel.<br>
<br>
It looks like senotesrel points to seattachmentsrel and thence to the original entity but I want someone to confirm the structure so I can reliably write a query to find all attachments for a bunch of Leads or Accounts for example.<br>
<br>
Al<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Regards<br>Vikas<br>Vtiger Team</div>
</div>