Newer Version Available

This content describes an older version of this product. View Latest

Example of an Uninstall Script

This sample uninstall script performs the following actions on package uninstall.
  • Inserts an entry in the feed describing which user did the uninstall and in which organization
  • Creates and sends an email message confirming the uninstall to that user

You can test an uninstall script using the testUninstall method of the Test class. This method takes as its argument a class that implements the UninstallHandler interface.

This sample shows how to test an uninstall script implemented in the UninstallClass Apex class.