Hello,
You can take advantage of
CustomDataHandler class that allows you to execute custom action when some CMS even occurs. The events are applied to all data items that are stored to the database. It includes documents, user information or any other settings. They receive the data object of type
DataClass that can be modified. In case of delete handlers, the class name and ID is provided. In your case, you could use for example
OnAfterDelete handler.
For more information I would like to point you to the following article:
Data handlerBest regards,
Michal Legen