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

Tiziano Morgia tiziano.morgia at gmail.com
Thu Mar 3 14:08:59 GMT 2022


I have found this:

include_once 'include/Webservices/Delete.php';try {        $wsid =
vtws_getWebserviceEntityId('Leads', 'CRMID') // Module_Webservice_ID x
CRM_ID        vtws_delete($wsid, $current_user);
} catch (WebServiceException $ex) {        echo $ex->getMessage();}

On this url =>
https://community.vtiger.com/help/vtigercrm/developers/server-apis.html
Is it the right way?
For attachments, I imagined there was a special function because I had
noticed that deleting a document from the vTiger module also removed the
underlying file.


Il giorno gio 3 mar 2022 alle ore 13:36 Sukhdev Mohan <s.mohan at myti.it> ha
scritto:

> 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/
>
> _______________________________________________
> http://www.vtiger.com/



-- 
.::Tiziano::.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20220303/8e49983a/attachment.html>


More information about the vtigercrm-developers mailing list