Mass update with custom query

Hi

I’m using mark_deleted in a custom module. But this is very slow. It’s taking 20 minutes to mark as deleted 300 related records.
If I use a custom query it doesn’t take even a second and it is done.
$customModule->db->query(“UPDATE ptin_proposalbundles SET deleted = 1 where proposal_id=’$customModule->id’”);

But because I don’t have many experience in suitecrm I’m not sure if this is a good option.
Is this risky?

Thank you

When you create object and mark as delete, It will also fire the logic hook and workflow if any,

1 Like

Ok probably that’s why is so slow …
thank you for the alert