Delete All Attachments for a table

34 views
Skip to first unread message

Norbert Bede

unread,
Jul 3, 2024, 2:37:35 AM (2 days ago) Jul 3
to iDempiere
Hi,

any idea how we can correctly delete attachments per a table ? (including storage provider and database records)

Norbert

Pedro Rozo

unread,
Jul 3, 2024, 10:50:12 AM (2 days ago) Jul 3
to iDempiere
Hi Norbert 

i had to do that in the past (to clean dummy data from an idempeire db)   and I used this SQL script,  you just need to finde the master table id (bp, invoices and so on) XXXXXX   and the record id (us the record or the master table (owner of the attacherment) for example c_invoice_id      and play with the values of your environment  ..

delete from ad_attachment where  ad_table_id = XXXXXX and   record_id  = YYYYY ;

Hope that helps you.

Pedro Rozo

unread,
Jul 3, 2024, 10:51:28 AM (2 days ago) Jul 3
to iDempiere
Once you deleted them with the previous sql, it soudl be easier to delete the storage provider manually or with a sql script as well  ..
Reply all
Reply to author
Forward
0 new messages