Alan,<div><br></div><div>Document attachment is handled like adding Related Record</div><div>to the module. This provides the ability to re-use existing documents </div><div>or have more than one attachment for a record.</div>

<div><div><br></div><div>You can try setting up a relation between your custom module and Document (setRelatedList)</div><div><br></div><div>Regards,</div><div>Prasad<br><br><div class="gmail_quote">On Mon, Jun 11, 2012 at 9:43 PM, Alan Lord (News) <span dir="ltr">&lt;<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 11/06/12 14:42, Prasad wrote:<br>
&gt; Alan,<br>
&gt;<br>
&gt; File attachement was a controlled operation and needs to be enabled by<br>
&gt; module.<br>
&gt;<br>
&gt; Generally, MODULENAME-&gt;save_module() should trigger the call to<br>
&gt; CRMEntity-&gt;uploadAndSaveFile($id,$module,$files);<br>
&gt;<br>
&gt; Look at modules/HelpDesk/HelpDesk.php<br>
<br>
</div>Thanks for the reply Prasad,<br>
<br>
I&#39;d already tried using the code from the Product module (as that has a<br>
specific attachment field for images) but trying any of the available UI<br>
types (including 69) for an attachment didn&#39;t work.<br>
<br>
I&#39;ve swapped in the code from HelpDesk.php but this doesn&#39;t seem to be<br>
any more helpful and there isn&#39;t a field on the Trouble Ticket to add an<br>
attachment directly anyway.<br>
<br>
Anyway I did a quick test with a UI Type 61 and the code from the<br>
HelpDesk module... The save_module() and subsequent<br>
insertIntoAttachment() functions are activating ok, but the $_FILE<br>
superglobal always seems to be empty. I can save attachments in the<br>
Document module so why can&#39;t I do it from here???<br>
<br>
TIA<br>
<div class="HOEnZb"><div class="h5"><br>
Al<br>
<br>
--<br>
Libertus Solutions<br>
<a href="http://www.libertus.co.uk" target="_blank">http://www.libertus.co.uk</a><br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</div></div></blockquote></div><br></div></div>