---
url: https://trigger.beyondthecloud.dev/installation.md
description: >-
  Install Trigger Lib in a Salesforce org - deploy via button, or copy the Apex
  classes, custom metadata types and page layouts together with the SOQL Lib and
  DML Lib dependencies.
---

# Installation

## Install via Unlocked Package {#install-via-unlocked-package}

Install the Trigger Lib unlocked package with `btcdev` namespace to your Salesforce environment:

`/packaging/installPackage.apexp?p0=04tP6000003oZaLIAU`

[Install on Sandbox](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tP6000003oZaLIAU)

[Install on Production](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tP6000003oZaLIAU)

## Deploy via Button {#deploy-via-button}

Click the button below to deploy Trigger Lib to your environment.

::: warning
The button deploys only the repo's `package` folder: Trigger Lib with `global` modifiers, without [SOQL Lib](https://soql.beyondthecloud.dev) and [DML Lib](https://dml.beyondthecloud.dev). The deploy fails unless the org already has a `SOQL` class and a `global` `DML` class. Otherwise, use [Copy and Deploy](#copy-and-deploy).
:::

## Copy and Deploy {#copy-and-deploy}

### Trigger Lib {#trigger-lib}

**Apex**

* [`TriggerOrchestrator.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/TriggerOrchestrator.cls)
* [`TriggerOrchestratorTest.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/TriggerOrchestratorTest.cls)
* [`TriggerTypes.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/TriggerTypes.cls)
* [`TriggerTypesTest.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/TriggerTypesTest.cls)
* [`BeforeInsert.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/BeforeInsert.cls)
* [`BeforeInsertTest.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/BeforeInsertTest.cls)
* [`AfterInsert.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/AfterInsert.cls)
* [`AfterInsertTest.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/AfterInsertTest.cls)
* [`BeforeUpdate.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/BeforeUpdate.cls)
* [`BeforeUpdateTest.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/BeforeUpdateTest.cls)
* [`AfterUpdate.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/AfterUpdate.cls)
* [`AfterUpdateTest.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/AfterUpdateTest.cls)
* [`BeforeDelete.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/BeforeDelete.cls)
* [`BeforeDeleteTest.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/BeforeDeleteTest.cls)
* [`AfterDelete.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/AfterDelete.cls)
* [`AfterDeleteTest.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/AfterDeleteTest.cls)
* [`AfterUndelete.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/AfterUndelete.cls)
* [`AfterUndeleteTest.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/classes/AfterUndeleteTest.cls)

**Custom Metadata Types**

* [`TriggerObject__mdt`](https://github.com/beyond-the-cloud-dev/trigger-lib/tree/main/force-app/main/default/objects/TriggerObject__mdt)
* [`TriggerHandler__mdt`](https://github.com/beyond-the-cloud-dev/trigger-lib/tree/main/force-app/main/default/objects/TriggerHandler__mdt)

**Page Layouts**

* [`TriggerObject__mdt-Trigger Object Layout`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/layouts/TriggerObject__mdt-Trigger%20Object%20Layout.layout-meta.xml)
* [`TriggerHandler__mdt-Trigger Handler Layout`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/layouts/TriggerHandler__mdt-Trigger%20Handler%20Layout.layout-meta.xml)

### SOQL Lib *(required)* {#soql-lib}

**Apex**

* [`SOQL.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/dependencies/soql-lib/SOQL.cls)
* [`SOQL_Test.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/dependencies/soql-lib/SOQL_Test.cls)

### DML Lib *(required)* {#dml-lib}

**Apex**

* [`DML.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/dependencies/dml-lib/DML.cls)
* [`DML_Test.cls`](https://github.com/beyond-the-cloud-dev/trigger-lib/blob/main/force-app/main/default/dependencies/dml-lib/DML_Test.cls)

::: tip
The button skips the examples. To add them to a scratch org or sandbox, run `sf project deploy start -d examples -o your-org-alias` in a clone of the repo.
:::
