[Vtigercrm-developers] Create module

Adam Heinz amh at metricwise.net
Fri Jun 15 11:20:37 PDT 2012


Well, for the most part, you should be able to get by on the instructions at

https://wiki.vtiger.com/index.php/CreatingEntityModule

The only problem that I see is your 1:1 user to module requirement.  It's
very easy to enforce that requirement at the database level with foreign
keys, but I'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

http://trac.vtiger.com/cgi-bin/trac.cgi/browser/vtigercrm/branches/5.4.0/vtlib/ModuleDir/5.4.0/Save.php

That said, here are some (bad?) ideas to get you thinking:

1. You could write a beforesave handler and manually do your referential
integrity checks there, but you'll have to handle redirecting the  page on
failure.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20120615/b7c18cd4/attachment-0001.html 


More information about the vtigercrm-developers mailing list