Friday, July 1, 2016

Apex code typically contains many things that we might be familiar with from other programming languages.




1. Naming Variables Apex

 Declaring variables:
datatype​ variable_name;
                           OR:
datatype​ variable_name = value;
EX:
      Account objAcc = new Account(); 
     List<Account> listAcc = new List<Account> (); 

You cannot use any of the Apex reserved keywords when naming variables, methods or classes, such as: list, for,...

 2. SOQL Query Apex 

This will be used to fetch the data from Salesforce database.

EX:
Select Id, name from Account

 3. Loop Statement Apex

Apex supports the following types of loops:
 + Do-while
 + While
 + For
EX:
for (Integer i = 0; i < 10; i++) {
     System.debug("SalesforceXQ");

 4. Conditional (if-else) Apex 

EX:
 Integer i = 1;
 if (i == 0) {
     System.debug('Salesforce');
 } else if (i == 1) {
     System.debug('XQ');
} else {
     System.debug('SalesforceXQ');
}
5. DML Statement Apex 

Performs the records insert, update, upsert, delete operation on the records in database.
Ex:
update listAccount 
6. Using Collections Apex

 Apex has the following types of collections:
 + Lists (arrays): A list is a collection of elements, such as Integers, Strings, objects, or other collections.
List<Account> listAcc = new List<Account> (); 
 + Maps: A map is a collection of key-value pairs. Keys can be any primitive data type. Values can include primitive data types, as well as objects and other collections. 
Map<Id, Account> mapAcc = new Map<Id, Account>(); 
 + Sets: A set is a collection of unique, unordered elements. It can contain primitive data types, such as String, Integer, Date, sObjects,... 
Set<String>setStr = new Set<String> ();
All Apex runs entirely on-demand on the Force.com platform, as shown in the following architecture diagram:

1. Developer Action: 

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

 2. End User Action: 

 When an end-user clicking a button or accessing a Visualforce page, the platform application server retrieves the compiled instructions from the metadata and sends them through the runtime interpreter before returning the result.

Thursday, June 30, 2016

If you're new to Salesforce development, you first have to know how to create Salesforce developer account.
Salesforce allows you to develop application for force.com for free.

1. What is Salesforce? 

Salesforce was founded in March 1999, the Salesforce Inc Company is headquartered at San Fransisco, California. Nowadays, everybody is talking about cloud computing and Salesforce is the innovative company behind the world’s Top 1 CRM (Customer Relationship Management) solution. Many business applications are working on Salesforce platform because of the security and reliability of their infrastructure.