If you’re new to Salesforce, you’ll start hearing references to this mysterious thing called an Apex trigger. Because it’s not covered in the Admin exam, it can sound a bit exotic. Scary, even. But it’s not. An Apex trigger is a piece of code that’s triggered when a Salesforce record is either created, updated, and/or deleted.
This code (written in Apex by a developer) is used to perform an action on the triggering record or a related record. Often, this is a field update. For example, a trigger could be written to automatically update the addresses of all related contacts when the account address is changed. Triggers can also be used to create new records, such as tasks or opportunities.
If this sound like a record-triggered flow, you’re right. Both are automation. The main difference is that an Apex trigger is programmatic, whereas the others (ie, flows, processes, workflow rules) are declarative (clicks not code).
Older organizations tend to have more programmatic automation because Apex triggers have been around longer than Salesforce declarative tools. Larger organizations also rely more on Apex triggers due to the complexity of their business processes.
These days, flows are becoming a popular automation choice as Salesforce gives Flow Builder more functionality and admins become more comfortable creating them. That said, Apex is a more powerful tool and organizations will continue to rely on it to create more complex automation solutions.
Likewise, you may start seeing more flows that use Action elements to call (or invoke) Apex methods (pieces of code that perform an action). This combines the ease of creating a flow with the power of Apex. This combination is more likely to be seen in screen flows.
While Salesforce Admins are not expected to code in Apex, it helps to understand what Apex is and when you may need to rely on it to accomplish more complicated automation in your org. It also helps to know how an Apex trigger may be interacting with other automation processes in your org.
You can learn more by completing the Apex Triggers module on Trailhead.