[Vtigercrm-developers] Event handlers add/update distinction

Darjan Prtic dprtic at gmail.com
Thu Jan 6 22:15:09 PST 2011


Hi!

Is there a way using event handlers to distinct when some record is being
updated (edited and then saved) and newly added?
When new record is saved i make relations in vtiger_crmentityrel table by
inserting corresponding crmid of that module and contact, also vice versa. I
do that in aftersave event because i need crmid of record that is being
created. That works fine. But now i have a problem when i just edit that
record and save it. New, unnecessary insert is being made to
vtiger_crmentityrel table with already existing values. What should be done
is _only_ update if necessary.

I use vtiger 5.10.

Thank you!
Darjan Prtic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20110107/fa9b222e/attachment-0002.html 


More information about the vtigercrm-developers mailing list