How can we Repair and Rebuild when creating a record through a custom hook file after save functionality? Note:- It saves records when we need them not regularly.

Hello all,

I'm wondering if there is a way to trigger Repair and Rebuild automatically when creating records via hooks after saving. I have a custom module where I create records, and I'm currently updating the JS file manually after creating each record to trigger Repair and Rebuild. Rather than having to go through the admin section to trigger Repair and Rebuild each time, I'd like to automatically run Repair and Rebuild as part of the record creation process.

Does anyone know if it's possible to automatically trigger Repair and Rebuild from a hook after saving a new record? Any pointers on how I could implement this would be greatly appreciated!

Thank you!