nerdexam
Salesforce

PDI · Question #233

A developer identifies the following triggers on the Expense __c object: The triggers process before delete, before insert, and before update events respectively. Which two techniques should the…

The correct answer is A. Create helper classes to execute the appropriate logic when a record is saved. D. Maintain all three triggers on the Expense__c object, but move the Apex logic out of the trigger. The developer has multiple triggers on the Expense__c object for different events and needs to implement best practices for trigger management.

Submitted by olafpl· Apr 18, 2026Logic and Process Automation

Question

A developer identifies the following triggers on the Expense __c object:

The triggers process before delete, before insert, and before update events respectively. Which two techniques should the developer implement to ensure trigger best practices are followed? Choose 2 answers

Options

  • ACreate helper classes to execute the appropriate logic when a record is saved.
  • BUnify the before insert and before update triggers and use Flow for the delete action.
  • CUnify all three triggers in a single trigger on the Expense__c object that includes all events.
  • DMaintain all three triggers on the Expense__c object, but move the Apex logic out of the trigger

How the community answered

(21 responses)
  • A
    81% (17)
  • B
    14% (3)
  • C
    5% (1)

Why each option

The developer has multiple triggers on the Expense__c object for different events and needs to implement best practices for trigger management.

ACreate helper classes to execute the appropriate logic when a record is saved.Correct

Moving complex business logic out of triggers and into dedicated helper classes is a crucial best practice for modularity, reusability, and testability.

BUnify the before insert and before update triggers and use Flow for the delete action.

While unifying triggers is a best practice, replacing an Apex trigger event with Flow is a different automation strategy and not a direct best practice for managing existing Apex triggers.

CUnify all three triggers in a single trigger on the Expense__c object that includes all events.

Unifying all three triggers into a single trigger that handles all events is a primary best practice, but A and D focus on the *internal structure* of trigger code, which are also critical best practices when implementing or refactoring any trigger, including a consolidated one.

DMaintain all three triggers on the Expense__c object, but move the Apex logic out of the triggerCorrect

The practice of moving Apex logic out of the trigger body makes triggers 'thin' and focused solely on handling events, which improves maintainability and adheres to separation of concerns.

Concept tested: Apex trigger best practices (thin triggers, handler classes)

Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_bestpractices.htm

Topics

#Apex Triggers#Trigger Best Practices#Handler Classes#Code Refactoring

Community Discussion

No community discussion yet for this question.

Full PDI Practice