Thanks for identifying the issue.<div><br></div><div>Please report the issue on trac system along with the preferred patch. We shall analyze it sooner and update that status on the ticket.<br><br><div class="gmail_quote">On Thu, Aug 25, 2011 at 4:20 PM, nuthell <span dir="ltr">&lt;<a href="mailto:nuthell@gmail.com">nuthell@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;"><font size="6"><b><span style="color:rgb(255, 0, 0)">File</span></b></font>:   vtiger_crm/data/CRMEntity.php<br><br> 100             if($on_focus-&gt;IsCustomModule &amp;&amp; method_exists($on_focus, &#39;save_related_module&#39;)) {<br>


 101                 $with_module = $module;<br> 102                 $with_crmid = $this-&gt;id;<br> 103                 $on_focus-&gt;save_related_module(<br> 104                    <span style="color:rgb(255, 0, 0)"> $for_module, $for_crmid, $with_module, $with_crmid</span>);<br>


 105             }<br><br>sometimes , <span style="color:rgb(255, 0, 0)">$for_crmid would be Empty or </span><span style="color:rgb(255, 0, 0)">Equate with $with_crmid</span> (depends on the $_REQUEST[&#39;return_id&#39;]).<br>


<br><font size="6"><b><span style="color:rgb(255, 0, 0)">Description:</span></b></font><br><br>I made a CustomModule and created a record. when I duplicate the record and save , it Occurs an Error.<br><br>(mysql): SELECT crmid FROM vtiger_crmentityrel WHERE crmid = &#39;&#39; AND module = &#39;MBOrders&#39; AND relcrmid = 175 AND relmodule = &#39;MBOrders&#39;  <br>


(mysql): INSERT INTO vtiger_crmentityrel(crmid, module, relcrmid, relmodule) VALUES(&#39;&#39;,&#39;MBOrders&#39;,175,&#39;MBOrders&#39;)  <br><br><font size="6"><b><span style="color:rgb(255, 0, 0)">Solution:</span></b></font><br>


<br> 100             if( <span style="color:rgb(0, 51, 0);background-color:rgb(153, 255, 153)">!empty($for_module) &amp;&amp; !empty($for_crmid) &amp;&amp; </span>$on_focus-&gt;IsCustomModule &amp;&amp; method_exists($on_focus, &#39;save_related_module&#39;)) {<br>


 101                 $with_module = $module;<br> 102                 $with_crmid = $this-&gt;id;<br>                     <span style="color:rgb(0, 51, 0);background-color:rgb(153, 255, 153)">  if($for_crmid != $with_crmid &amp;&amp; $for_module != $with_module)</span><br>


 103                 $on_focus-&gt;save_related_module(<br> 104                    <span style="color:rgb(255, 0, 0)"> $for_module, $for_crmid, $with_module, $with_crmid</span>);<br> 105             }<br>
<br>_______________________________________________<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>Regards,<br>Asha<br>vtiger Team<br><br><b>Connect with us on: </b><a href="http://twitter.com/#%21/vtigercrm" target="_blank">Twitter</a> <b>I</b> <a href="http://www.facebook.com/pages/vtiger/226866697333578?sk=wall" target="_blank">Facebook</a> <b>I</b> <a href="http://blog.vtiger.com/" target="_blank">Blog</a><b> I</b> <a href="http://wiki.vtiger.com/index.php/Main_Page" target="_blank">Wiki</a> <b>I </b><a href="http://forums.vtiger.com/" target="_blank">Forums </a><b>I</b> <a href="http://vtiger.com/" target="_blank">Website</a><br>

<br>
</div>