The MicroTrigger Dashboard displays real-time information about the Apex Triggers and Handlers that run in a specific DML transaction. It can also notify you when your Apex Trigger transaction hits a threshold limit that you set.
The MicroTrigger Dashboard is dependent on the MicroTrigger Framework and Apex TreeDiagram Library, so they need to be installed/deployed in the Org or Scratch Org before the MicroTrigger Dashboard.
- Clone the MicroTrigger Framework repo, then create an Unlocked Package and Unlocked Package version. In the sfdx-project.json file, replace the MICROTRIGGERFRAMEWORK_PACKAGE_ID with the created Package ID.
- Clone the TreeDiagram Library repo, then create an Unlocked Package and Unlocked Package version. In in the sfdx-project.json file, replace the TREEDIAGRAMLIBRARY_PACKAGE_ID with the created Package ID.
- Clone the current repo then create an Unlocked Package and Unlocked Package version. In the sfdx-project.json file, replace the replace the MICROTRIGGERFRAMEWORK_PACKAGE_ID with the MicroTrigger Package ID and the TREEDIAGRAMLIBRARY_PACKAGE_ID with the created TreeDiagram Library Package ID.
To run the MicroTrigger,
- Create a Scratch Org, and install first the MicroTrigger Framework and the TreeDiagram packages, then the MicroTrigger Dashboard package in the Scratch Org,
- Clone and deploy the MicroTrigger Examples to the Scratch Org.
- To view the Trigger Dashboard of a specific DML transaction, open the Visualforce Page "TreeDiagramPage", then run one of the MicroTrigger Examples.
- To view the MicroTrigger Notifications, set the "DML Statements" or "SOQL Queries" fields of the Custom Settings "MicroTrigger Notification Settings" to 1. This will create a MicroTrigger Notification (Custom Object) record, each time the DML Statement or SOQL Limit in a Trigger transaction is over 1%.