<div><div>thanks for your help,</div><div><br></div><div>One week ago, I created a module with tutorial help <a href="http://crmevolutivo.com/wiki/doku.php?id=vtlibrelated">http://crmevolutivo.com/wiki/doku.php?id=vtlibrelated</a>, this module(abstract) related a module item with many users</div>
<div><br></div><div>my intention is create a 1:1 relation (a abstract of a user )with vtlib and install this modules in other places automatically, without configure each database, using only vtlib</div></div><div><br></div>
<div><br></div><div><br><div class="gmail_quote">2012/6/15 Adam Heinz <span dir="ltr">&lt;<a href="mailto:amh@metricwise.net" target="_blank">amh@metricwise.net</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote">Well, for the most part, you should be able to get by on the instructions at</div><div class="gmail_quote"><br></div><div class="gmail_quote"><a href="https://wiki.vtiger.com/index.php/CreatingEntityModule" target="_blank">https://wiki.vtiger.com/index.php/CreatingEntityModule</a>
</div><div class="gmail_quote"><br></div><div class="gmail_quote">The only problem that I see is your 1:1 user to module requirement.  It&#39;s very easy to enforce that requirement at the database level with foreign keys, but I&#39;m not sure what the best way to do it in the application layer will be.  The vTiger save endpoints are optimistic and not really designed to handle exceptions from the database layer.  Notice the lack of any sort of handling of the results of the save call in</div>

<div class="gmail_quote"><br></div><div class="gmail_quote"><a href="http://trac.vtiger.com/cgi-bin/trac.cgi/browser/vtigercrm/branches/5.4.0/vtlib/ModuleDir/5.4.0/Save.php" target="_blank">http://trac.vtiger.com/cgi-bin/trac.cgi/browser/vtigercrm/branches/5.4.0/vtlib/ModuleDir/5.4.0/Save.php</a>
</div><div class="gmail_quote"><br></div><div class="gmail_quote">That said, here are some (bad?) ideas to get you thinking:</div><div class="gmail_quote"><br></div><div class="gmail_quote">1. You could write a beforesave handler and manually do your referential integrity checks there, but you&#39;ll have to handle redirecting the  page on failure.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">2. You could make the userid field read-only, and only allow creation of new module entities from an aftersave handler when new users are created.</div>
<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><font size="4"><b>William Bejarano</b></font><br>Ing. Sistemas<br><a href="http://www.ito-software.co">www.ito-software.co</a><br>
<br>
</div>