Before delete Business Rule on sys_attachment zero out the file

Yamilla Manjko
Tera Guru

I need to prevent users to delete a specific attachment. I created a before delete BR and it prevents the record from being deleted but it erases all the file content, it is a MS Word file.

To use ACL I would have to update al least ten others that are not on my project for it to work properly.

Did anyone else faced this? Is there a way to prevent deletion trough business rule whitout erasing the file content?

1 ACCEPTED SOLUTION

Yamilla Manjko
Tera Guru

I figured it out! The Business Rule also needs to be on the sys_attachment_doc table. It was running on the sys_attachment table so it was allowing the deleting of the Word's content but not the file itself. I created a business rule to run on sys_attachment_doc table and now it's working perfectly.

Thank you!

View solution in original post

2 REPLIES 2

SumanthDosapati
Mega Sage
Mega Sage

Hi,

What did you do in your before business rule?

Can you share configuration.

 

Regards,
Sumanth

Yamilla Manjko
Tera Guru

I figured it out! The Business Rule also needs to be on the sys_attachment_doc table. It was running on the sys_attachment table so it was allowing the deleting of the Word's content but not the file itself. I created a business rule to run on sys_attachment_doc table and now it's working perfectly.

Thank you!