Newer Version Available
When Should I Use Apex?
Apex
- Create Web services.
- Create email services.
- Perform complex validation over multiple objects.
- Create complex business processes that are not supported by workflow.
- Create custom transactional logic (logic that occurs over the entire transaction, not just with a single record or object).
- Attach custom logic to another operation, such as saving a record, so that it occurs whenever the operation is executed, regardless of whether it originates in the user interface, a Visualforce page, or from SOAP API.
Lightning Components
Develop Lightning components to customize Lightning Experience, the Salesforce app, or to build your own standalone apps. You can also use out-of-the-box components to speed up development.
The Lightning Component framework is a client-side framework (Visualforce is primarily server-side). You write client-side JavaScript code, and user interface processing takes place on the client as much as possible, until you need to get data from or save data to Salesforce.
For more information, see the Component Library.
Visualforce
- Build wizards and other multistep processes.
- Create your own custom flow control through an application.
- Define navigation patterns and data-specific rules for optimal, efficient application interaction.
For more information, see the Visualforce Developer's Guide.
SOAP API
Use standard SOAP API calls if you want to add functionality to a composite application that processes only one type of record at a time and does not require any transactional control (such as setting a Savepoint or rolling back changes).
For more information, see the SOAP API Developer Guide.