ApexOld
Apex Code
Force.com Apex Code is a strongly-typed programming language that executes on the Force.com platform. Apex is used to add business logic to applications, to write database triggers, and to program controllers in the user interface layer. It has a tight integration with the database and query language, good web services support, and includes features such as futures and governors for execution in a multi-tenant environment.
Overview of Apex Code
An Introduction to Apex Code: A technical introduction to the Apex programming language, looking at its syntax, features, and use on the Force.com Platform.Apex Code: The World's First On-Demand Programming Language: Whitepaper that provides an overview of the capabilities and technology of Apex.
Introduction to Apex : Recorded presentation of the Apex code overview.
Other Articles
How to Write Good Unit TestsApex Code Best Practices
Governors in Apex Code
An Introduction to Apex Code Test Methods
Security Tips for Apex and Visualforce Developers
Official Documentation
Force.com Apex Code Developer's Guide- Version 17.0 for Winter '10: HTML | PDF | Governor Limits | Earlier Versions
- (Audience: Developers) Reference for Apex, a Java-like programming language that allows you to add custom logic to your apps.
- Basic Tutorial | Advanced Tutorial
- (Audience: Developers) A quick start tutorial introduction to the Apex programming language.
Presentations
Apex Deep Dive: Advanced Apex Techniques: Recorded at Dreamforce '08, this presentation looks at using Apex to developer Email services, dynamic Apex and asynchronous Apex.Apex Test Coverage Best Practices: Recorded at Dreamforce '08, this presentation examines Apex test coverage and how it impacts how the deployment of high-quality apps on the Force.com Platform.
Apex Code Demo: Recorded demo of a few apps created with Apex
Getting Started with Apex Code: Introduction to Apex Code from Dreamforce '07.
Calling Web Services from Force.com (formerly Force.com SOA): Recorded demo highlighting the capabilities of Force.com for calling external Web services.
Code samples
The following code comes straight from the free Force.com Cookbook.
Avoiding runtime governor limits
Avoiding runtime governor limits - alternative
Avoiding runtime governor limits - alternative 2
Avoiding runtime governor limits - inefficient alternative
This is a helper class called by line 17 & 18
Avoiding runtime governor limits - alternative 3
Preventing duplicate lead entry, using maps
Tester application for lead de-deduplicator
Correlating query results with maps
Controlling recursive triggers with member variables
This one should be linked to the one above - it is a sub-taks
Tester application for recursive trigger
Hello World' application defined as a web service
S-control that calls the web service.
Apex class to determine test coverage.
Trigger that calls class method
Class called by trigger in 38.
Trigger to update data in child records
Populate values in child record from parent record
Web service called from a pushbutton
Pushbutton that calls a Web service
Pushbutton to delete multiple records
Pushbutton to update multiple records
Template for a custom help s-control
Reading a parameter in an s-control
Passing a parameter to an s-control
Redirecting a User to an Edit, Detail, or List Page
Trigger to update multiple records (part of a solution to receive email updates every time a record changes)
S-control to format currency (part of roll-up summary field for different types of opportunities)
S-control snippet (part of roll-up summary field for different types of opportunities)
S-control to display data from a related record on a detail page