Posted on

Indroduction: What is Apex Programming Language

Apex is a object-oriented programming language developed by Salesforce.com. This language allows developers to execute flow and transaction control statements on the Force.com platform server in conjunction with calls to the Force.com​ API.

Apex

The syntax of this language is similar look alike  to Java and acts like database stored procedures. Language is included in Performance Edition, Unlimited Edition, Enterprise Edition, and Developer Edition.

Support provided by Apex

Apex has built-in support for common Force.com platform including:

  • Inline Salesforce Object Query Language (SOQL) and Salesforce Object Search Language (SOSL) queries that return lists of sObject records.
  • Data manipulation language (DML) calls, such as INSERT, UPDATE, and DELETE.
  • Custom public Force.com API calls that can be built from stored Apex methods

When Should You Use Apex?

How does Apex Work

The Salesforce prebuilt applications provide powerful CRM functionality. Apex can be used to achieve different task.

  1. You can create a Website.
  2. Create email services.
  3. Create complex business processes.
  4. Attach custom logic to another operation, such as saving a record.

How Does Apex Work?

All Apex runs entirely on-demand on the Force.com platform.

  • Step 1

First developer writes and saves programming code to the platform.

  • Step 2

Then platform application server first compiles the code into an abstract set of instructions that can be understood by the Apex runtime interpreter, and then saves those instructions as metadata.

  • Step 3

As soon as the end user clicks to trigger execution, the platform application server retrieves the compiled instructions from the metadata and sends them through runtime interpreter before returning the result.

Cannot be used to:

  • Render elements in the user interface other than error messages
  • Create temporary files
  • Spawn threads

Latest New Version

Winter ’17 is the new version of Apex as per Salesforce.com