An uninstall script is an Apex class that implements the UninstallHandler interface. This interface has a single method called onUninstall that specifies the actions to be performed on
uninstall.
The
onUninstall method takes a context object as its argument, which provides the
following information.
- The org ID of the organization in which the uninstall takes place.
- The user ID of the user who initiated the uninstall.
The context argument is an object whose type is the
UninstallContext interface. This interface is
automatically implemented by the system. The following definition of the
UninstallContext interface shows the methods you can call on
the context
argument.