Correct Answer: D
A trigger may fire multiple times during a transaction because of the order of execution of different automation tools in Salesforce. According to the documentation, the order of execution is as follows:
* Executes all before triggers.
* Saves the record to the database, but doesn't commit yet.
* Executes all after triggers.
* Executes assignment rules.
* Executes auto-response rules.
* Executes workflow rules.
* If there are workflow field updates, updates the record again.
* If the record was updated with workflow field updates, fires before update triggers and after update triggers one more time (and only one more time), in addition to standard validations. Custom validation rules, duplicate rules, and escalation rules are not run again.
* Executes processes and flows launched via processes and flow trigger workflow actions. When a process or flow executes a DML operation, the affected record goes through the save procedure.
* Executes escalation rules.
* Executes entitlement rules.
* If the record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent record. Parent record goes through save procedure.
* If the parent record is updated, and a grandparent record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the grandparent record. Grandparent record goes through save procedure.
* Executes Criteria Based Sharing evaluation.
* Commits all DML operations to the database.
* Executes post-commit logic, such as sending email.
As you can see, there are several steps that can cause the record to go through the save procedure again, which will fire the triggers again. Therefore, the developer should consider this possibility and write the trigger code accordingly to avoid unwanted side effects or recursion. For example, the developer can use static variables to track the trigger invocation or use bulkified patterns to handle collections of records efficiently.
References:
* 1: Order of Execution (Apex Developer Guide)