[Vtigercrm-developers] Correct way to Delete Entity records and related

Sukhdev Mohan s.mohan at myti.it
Thu Mar 3 12:32:45 GMT 2022


Use vtws_delete() twice to delete from db.
To physically delete the attachments just get the path and file name from
db and then proceed to delete the files via script.

Il gio 3 mar 2022, 13:29 Tiziano Morgia <tiziano.morgia at gmail.com> ha
scritto:

> Hi to all,
>    we have a vTiger instance that contains a high number of custom modules
> on which we import, through php scripts, a high number of data including
> attachments.
>    We therefore need to cancel the following types of data when importing
> data and / or through scheduled activities:
> - Records of custom modules
> - Attachments to the records of the previous point (including associated
> files on disk)
> - Contain the number of records of the change history (if active on the
> module). For example, keep the last 10 changes for each single entity.
>
> We can delete it directly using db query ($adb->query("DELETE FROM xxx");)
> but I think that there is a correct way, using the vtlib or similar, to
> delete the three types of data, or not?
> I tried to search but find nothing about it.
> Has anyone had a similar need?
>
> Thanks in advance,
> Tiziano
>
> _______________________________________________
> http://www.vtiger.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20220303/728dc1a3/attachment.html>


More information about the vtigercrm-developers mailing list