Salesforce Platform Developer I (legacy) — Question 222

For which example task should a developer use a trigger rather than a workflow rule?

Answer options

Correct answer: D

Explanation

A trigger is used for tasks that require immediate execution of code when records are created or updated, such as setting the primary Contact on an Account record. Workflow rules are more suited for automated actions like sending emails or notifications, but they cannot handle complex logic or interact with external systems as effectively as triggers.