PDI · Question #58
Which action may cause triggers to fire?
The correct answer is A. Updates to Feed Items. Direct DML operations, such as updating a FeedItem record, will cause Apex triggers defined on that object to fire.
Question
Which action may cause triggers to fire?
Options
- AUpdates to Feed Items
- BRenaming or replacing a picklist entry
- CChanging a user's default division when the transfer division option is checked
- DCascading delete operations
How the community answered
(48 responses)- A85% (41)
- B4% (2)
- C8% (4)
- D2% (1)
Why each option
Direct DML operations, such as updating a FeedItem record, will cause Apex triggers defined on that object to fire.
Updates to FeedItem records constitute a DML operation on the FeedItem object. An Apex trigger configured for before update or after update events on the FeedItem object will consequently fire.
Renaming or replacing a picklist entry is a metadata change and does not involve DML operations on individual records, thus it does not fire Apex triggers.
Changing a user's default division is a system administrative action related to organizational settings, not a DML operation on standard data records that would typically fire triggers.
According to the Salesforce Apex "Triggers and Order of Execution", if a record is deleted due to a cascade-delete, the delete trigger on that child record is generally not fired.
Concept tested: Apex trigger events
Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
Topics
Community Discussion
No community discussion yet for this question.