<div dir="ltr"><div>I have found this:</div><div>
<pre><span class="gmail-x">include_once 'include/Webservices/Delete.php';</span>
<span class="gmail-x">try {</span>
<span class="gmail-x">        $wsid = vtws_getWebserviceEntityId('Leads', 'CRMID') // Module_Webservice_ID x CRM_ID</span>
<span class="gmail-x">        vtws_delete($wsid, $current_user);</span>

<span class="gmail-x">} catch (WebServiceException $ex) {</span>
<span class="gmail-x">        echo $ex->getMessage();</span>
<span class="gmail-x">}</span></pre>

</div><div>On this url => <a href="https://community.vtiger.com/help/vtigercrm/developers/server-apis.html">https://community.vtiger.com/help/vtigercrm/developers/server-apis.html</a></div><div>Is it the right way?</div><div>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.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 3 mar 2022 alle ore 13:36 Sukhdev Mohan <<a href="mailto:s.mohan@myti.it">s.mohan@myti.it</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Use vtws_delete() twice to delete from db.<div dir="auto">To physically delete the attachments just get the path and file name from db and then proceed to delete the files via script.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il gio 3 mar 2022, 13:29 Tiziano Morgia <<a href="mailto:tiziano.morgia@gmail.com" target="_blank">tiziano.morgia@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi to all,</div>   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.<br>   We therefore need to cancel the following types of data when importing data and / or through scheduled activities:<br><div>- Records of custom modules<br></div>- Attachments to the records of the previous point (including associated files on disk)<br>- 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.<br><br>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?<br>I tried to search but find nothing about it.<br>Has anyone had a similar need?<br><br><div>Thanks in advance,</div><div>Tiziano</div><div><br></div></div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">.::Tiziano::.<br></div>