PDI practice question 30 of 30
Which two actions may cause triggers to fire? Choose 2 answers
Full set: 201 questionsApex triggers are invoked by Data Manipulation Language (DML) events such as insert, update, delete, and undelete. Cascading delete operations (C) occur when a parent record in certain relationships (e.g., master-detail) is deleted, causing its child records to be deleted as well. Each deletion of a child record is a DML delete event that will fire any triggers on that child object. Updates to FeedItem (B), which represents a Chatter post, are standard update DML events. Like most standard and all custom objects, FeedItem supports triggers, so an update will cause its associated triggers to fire.
A. Changing a user's default division when the transfer division option is checked: This is a setup change. While the resulting record ownership transfers are update DML operations that fire triggers, the initial action itself is not a direct DML event.
D. Renaming or replacing a picklist entry: This is a metadata change. Although this action can initiate a mass update DML operation on records using that value, the action itself is a metadata configuration, not a direct DML event.
1. Apex Developer Guide, "Triggers": The guide introduces triggers by stating, "Apex triggers enable you to perform custom actions before or after events to records in Salesforce, such as insertions, updates, or deletions." This establishes the direct link between DML events and trigger execution.
2. Apex Developer Guide, "Triggers and Order of Execution": This section details the sequence of events that occur during a DML operation, confirming that triggers are a core part of the DML execution path. Both an update (like on a FeedItem) and a delete (as in a cascade delete) initiate this order of execution.
3. Salesforce Help, "Considerations for Deleting Records": In the context of relationships, the documentation states, "Deleting a parent record deletes its child and grandchild records in a cascade delete... Triggers on the child objects are fired." This directly confirms that cascading deletes fire triggers.
4. Object Reference for Salesforce and Lightning Platform, "FeedItem": The documentation for the FeedItem sObject lists trigger as a supported call, confirming that DML operations on this object can invoke Apex triggers.
Keep practicing
Take the free PDI practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other PDI practice questions
- Question 1What can be used to override the Account's standard Edit button for Lightning Experience?
- Question 4Universal Containers (UC) wants to lower its shipping cost while making the shipping proc…
- Question 5A developer has an integer variable called maxAttempts. The developer needs to ensure tha…
- Question 7Universal Containers wants to back up all of the data and attachments in its Salesforce o…
- Question 8Universal Containers hires a developer to build a custom search page to help users find t…
- Question 9As part of new feature development, a developer is asked to build a responsive applicatio…
