Hi!<div><br></div><div>Is there a way using event handlers to distinct when some record is being updated (edited and then saved) and newly added?</div><div>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.</div>

<div><br></div><div>I use vtiger 5.10.</div><div><br></div><div>Thank you!</div><div><div>Darjan Prtic<br>
</div></div>