The add-in is visible in multiple websites in the tenancy, but the event does not run separately for each of these. After four timeouts, Share Point rolls back the entire add-in installation.
The full implications of these facts are discussed in Include rollback logic and "already done" logic in your add-in event handlers. Removal of an add-in only moves the add-in to the user's recycle bin.
For more information, see Include rollback logic and "already done" logic in your add-in event handlers.
Note When you install an add-in with Tenant scope, it is installed to the add-in catalog site collection, and the App Installed event runs then and only then.
I write function because I have more than one child tables for same parent.
So rather than write deleting code for finding child data with same id and deleting data I write code and pass List and Parent Id to that function.
But you don't want to delete things that still have a useful life after the add-in is gone: if a list or website created by your App Installed handler is still going to be used, don't delete it in your App Uninstalling handler.
The main purpose of a handler for this event is to delete or recycle things that were deployed with an App Installed (or an App Updated) handler.The URL of the RER service is registered for the events it handles.There are two ways to register a handler: The field update events are about changing the properties of a field (column) on a list, such as whether it is sortable, not about changing the data in the field.Share Point cannot delete these things, or move them to the recycle bin, because it doesn't know about them, at least not as components of the add-in.It is usually a good practice to remove these things.Two more steps are required before the App Uninstalling event is triggered.