What is APEX? How can I get Started in Salesforce Coding?

In the past when we start to learn any Software we try to get a copy of the software and install on our computer. This concept is now changed with the arrival of cloud. With Salesforce.com you do not  have to install any product to start learning programming. You can do everything from a browser. Let me walk you through the steps to write your first ‘Hello World’ and beyond in APEX.

What is APEX?

APEX is the Salesforce’s programming language which runs in the cloud on the Force.com platform servers.

How can I get a Salesforce account? Is it free?

You can sign up for developer account from Salesforce by visiting https://developer.salesforce.com. It is free and the developer account has everything you need to become an expert APEX Coder.

 

Where do I write APEX code?

You can write APEX in Developer Console, Salesforce UI, or Force.com IDE. One important point to remember is, that you can write APEX code in your developer org and Sandbox environments only.

Developer Console:

Salesforce -Sales Cloud

  • Click on your name from at top right corner, and then click on Developer Console.
  • Click Debug > Open Execute Anonymous Window or CTRL+E.
  • Type System.debug( ‘Hello World’ );
  • Click on Execute.

Salesforce -Developer Console

  • Open the log file from Logs tab. Under log there are few check boxes available to filter the results. Click on Debug Only check box
  • You will get the result:

20:56:11:027 USER_DEBUG [1]|DEBUG|Hello World

Some times you may need to query some data while developing the code. You can use the Query Editor from Developer console.

See the SOQL query below:

dc-query-editor

You can see the results:

dc-query-data

For more information check out the following links:

Salesforce UI: 

You can create and modify APEX Classes and triggers from Salesforce UI. Please follow the steps below:

APEX Classes:

  • From Setup, enter “Apex Classes” in the Quick Find box, then select Apex Classes and click New.

APEX Triggers

  • For standard objects:
    • From Setup, enter “Object Name” in the Quick Find box, then select Triggers and click New.
  • For custom objects:
    • From Setup, enter “Objects” in the Quick Find box, then click on Objects to get a list of custom objects.
    • Choose the desired object where you want to writr the trigger.
    • Go to  Triggers section and click New.
Force.com IDE

Force.com IDE  provides programmers with integrated development environment to develop Force.com applications using APEX. Unlike Developer Console, Force.com IDE enable you to migrate the code from one environment to another.

For more information check out the following links:

 
Author:

Ajomon Joseph AJOMON JOSEPH
Senior Salesforce Architect
In Connect me on LinkedIn
twitter Follow me on Twitter @apexcoder
blogger Subscribe to my blog https://apexcoder.com
email Email me ajomon@apexcoder.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s