Hello,
I need to truncate the tables of a custom module when admin disable it in backend. There is any function for it. ? How can we do it ?
Could you please help?
Thank you!
Solved! Go to Solution.
Hi @arun_tr1,
One thing, when we disable custom module by admin then it is not fully disabled. It disable module output only.
You need to disable from app/etc/modules/MODULE_XML_FILE.xml.
You need to edit that file and make :
<active>true</active> to <active>false</active>
There is not any direct way to truncate table for disable module. You can truncate from the database.
TRUNCATE TABLE TABLE_NAME;
I hope it will help you!
Hi @Vimal Kumar
Thanks for your help but i have a little doubt on it. How we can make the change dynamically in code level. Is there any way ? Also i don't have such file (app/etc/modules/MODULE_XML_FILE.xml).
Is need to create it? I am a beginner in magento so could you please help me to solve this?
Thank you!
Hi @Vimal Kumar
Thanks for your great effort. But my requirement is to truncate the table dynamically when admin disable that custom module, is there any function triggered or is any way to trigger a function truncate the table at the same time admin disable that module.
It will be great have a solution for it.
Thank you!