Skip to content

Commit dd741a2

Browse files
authored
Merge pull request kevinohara80#11 from renatoliveira/master
2 parents 5dd5177 + 949fb44 commit dd741a2

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public class OpportunityTriggerHandler extends TriggerHandler {
8787

8888
### Bypass API
8989

90-
What if you want to tell other trigger handlers to halt execution? That's easy with the bypass api. Example.
90+
What if you want to tell other trigger handlers to halt execution? That's easy with the bypass api:
9191
9292
```java
9393
public class OpportunityTriggerHandler extends TriggerHandler {
@@ -112,6 +112,24 @@ public class OpportunityTriggerHandler extends TriggerHandler {
112112
}
113113
```
114114

115+
If you need to check if a handler is bypassed, use the `isBypassed` method:
116+
117+
```java
118+
if (TriggerHandler.isBypassed('AccountTriggerHandler')) {
119+
// ... do something if the Account trigger handler is bypassed!
120+
}
121+
```
122+
123+
If you want to clear all bypasses for the transaction, simple use the `clearAllBypasses` method, as in:
124+
125+
```java
126+
// ... done with bypasses!
127+
128+
TriggerHandler.clearAllBypasses();
129+
130+
// ... now handlers won't be ignored!
131+
```
132+
115133
## Overridable Methods
116134

117135
Here are all of the methods that you can override. All of the context possibilities are supported.
@@ -123,6 +141,3 @@ Here are all of the methods that you can override. All of the context possibilit
123141
* `afterUpdate()`
124142
* `afterDelete()`
125143
* `afterUndelete()`
126-
127-
128-

0 commit comments

Comments
 (0)