Skip to content

Commit

Permalink
Trigger Handler 1.0.2
Browse files Browse the repository at this point in the history
Fixed a bug where isDelete could report incorrect value during UNDELETE trigger operation in mocked tests.
  • Loading branch information
pkozuchowski committed Jun 30, 2024
1 parent e11cf95 commit 52e0b83
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
12 changes: 9 additions & 3 deletions docs/TriggerHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
*Orchestrator for Apex Trigger Logic*

[Source](https://github.com/pkozuchowski/Apex-Opensource-Library/tree/master/force-app/commons/triggerHandler)
[Install In Sandbox](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t08000000cSiXAAU)
[Install In Production](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t08000000cSiXAAU)
[Install In Sandbox](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t08000000UK6aAAG)
[Install In Production](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t08000000UK6aAAG)

```bash
sf project deploy start -d "force-app/commons/triggerHandler" -o sfdxOrg
Expand Down Expand Up @@ -216,4 +216,10 @@ AND(
```

All toggles are defined as negatives (Disable X vs Enable X) because that makes them enabled by default — both in real usage and in unit tests.
You won't have to insert them in every test class or remember about manual steps to enable custom setting.
You won't have to insert them in every test class or remember about manual steps to enable custom setting.

---
# Change Log

### 1.0.2
* Fixed a bug where isDelete could report incorrect value during UNDELETE trigger operation in mocked tests.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public virtual class TriggerContext {
String op = operation.name();
this.isInsert = op.contains('INSERT');
this.isUpdate = op.contains('UPDATE');
this.isDelete = op.contains('DELETE');
this.isDelete = op.contains('_DELETE');
this.isUndelete = op.contains('UNDELETE');
this.isBefore = op.contains('BEFORE');
this.isAfter = op.contains('AFTER');
Expand Down
3 changes: 2 additions & 1 deletion sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"path": "force-app/commons/triggerHandler",
"package": "Trigger Handler",
"versionName": "ver 1.0",
"versionNumber": "1.0.1.NEXT",
"versionNumber": "1.0.2.NEXT",
"default": false,
"versionDescription": ""
},
Expand Down Expand Up @@ -125,6 +125,7 @@
"packageAliases": {
"Trigger Handler": "0Ho08000000CaS0CAK",
"Trigger [email protected]": "04t08000000cSiXAAU",
"Trigger [email protected]": "04t08000000UK6aAAG",
"Metadata Trigger Handler": "0Ho08000000CaS5CAK",
"Metadata Trigger [email protected]": "04t08000000ga5MAAQ",
"Metadata Trigger [email protected]": "04t08000000ga8uAAA",
Expand Down

0 comments on commit 52e0b83

Please sign in to comment.