This content describes an older version of this product.
View Latest
Writing Apex
Apex is like Java for Salesforce. It enables you to add and interact with data in the
Force.com platform persistence layer. It uses classes, data types, variables, and if-else
statements. You can make it execute based on a condition, or have a block of code execute
repeatedly.
Data Types and Variables
Apex uses data types, variables, and related language constructs such as enums, constants, expressions, operators, and assignment statements.
Control Flow Statements
Apex provides if-else statements and loops to control the flow of code execution. Statements are generally executed line by line, in the order they appear. With control flow statements, you can make Apex code execute based on a certain condition, or have a block of code execute repeatedly.
Working with Data in Apex
You can add and interact with data in the Force.com platform persistence layer. The sObject data type is the main data type that holds data objects. You’ll use Data Manipulation Language (DML) to work with data, and use query languages to retrieve data, such as the (), among other things.