Getting started with Trap.apex
Normal Trigger Event Handler
If you do not want to use the stream style Trap.apex, you can still use a downgraded style, which resembles the normal trigger event handlers.
public with sharing class CaseTrigger extends Trap.TriggerHandler {
public override void bulkBefore() {
// Custom code
}
public override void beforeInsert(SObject newSO) {
Trap.Context triggerContext = this.getTriggerContext();
// Custom code
}
}
See, put your code in bulkBefore
to query data, and specific logic in the beforeInsert
.