Salesforce provides two modules, one is admin module and the other is developer module. A Salesforce developer can execute code and customise code, based on the client requirement. There are different platforms to work on programming. They include force.com (developer platform), etc. Salesforce developer can be assigned to either front-end development or back-end development. Front-end development platforms include Apex and Visualforce. The back-end development includes SOQL.
Apex is the first language which runs on cloud/ internet. It is OOPS language which helps the developers to execute and transact statements via Lightning Platform server, with conjunction of calls to the API. It is similar to Java and perform database stored procedures. The code can be initiated via web service calls and triggers from objects. Apex allows developers to include business logic to the events included.
SOQL is a back-end source for Salesforce. It is used to read the records from the Salesforce. Salesforce also provides SOQL - Salesforce Object Oriented Language which is used to read the stored data.
Table of Contents
Basically, we have 2 different modules in Salesforce:
Let us look into few scenarios where coding is important than administration in Salesforce.
Hint: WFR(workflow rule).
Hint: It is not possible in configuration method, so we follow the coding method to fulfill this requirement from client side.
Hint: Outbound message in the WFR (workflow rule).
Hint: This is not possible by Configuration method. It can be done programmatically.
[Related Page: Salesforce Tutorial For Beginners]
According to USA market trends, Salesforce Administrator is paid 40 to 50 USD per hour, where as the Salesforce Developer is paid 80 to 90 USD per hour.
Salesforce programming includes Apex, It is a strongly typed, OOP Language which allows developers to transact control statements on Salesforce servers. Apex is similar to Java and acts like DB stored procedures, It enables the developers for adding business logic for most system events. Code can be initiated with Web service requests & from triggers on objects.
How to become confident in Salesforce Development?
By following the below mentioned points, we can be confident in starting Salesforce Development.
APEX: It is the world’s first language which can run on cloud/internet. We have different symbols in the programming to use,
integer age = 20; - whenever the statement is complete, it should end with a semicolon.
Group of statements:
Let us assume few statements with values included in it.
Integer bonus = 20; Integer salary = 3000; Integer sum; Sum = bonus + salary;
[Note: bonus, salary, sum are variables.]
The name given to the memory location where we store some data and used in the program, is called a variable. Why do we need to store data? - Without storing data, we cannot use the data for the future use.
Note: Every variable is first declared with the type of data it’s going to store. It is mandate to declare before we start using that variable.
Integer = Number, (1, 10, 100,1000 etc) String = Text data, ( sara, john etc) Double = Fraction data. (1.2, 10.2, 234.235 etc)
Take 3 variables and assign values to it.
ClientName = 'Adam'; Age = 28; Salary = 989.99;
Salesforce data types includes primitive, collection & sObjects. These are classified based on their features.
Commenting in the programming is quite common to understand what the statement specifies.
Comment can be given to single line or group of lines together.
Eg:
Frequently asked Salesforce Interview Questions & Answers
Operators are the symbols which operates on value or a variable. “ + “ - is an operator to perform addition.
Apex has wide range of operators to perform various operations. Operators can be classified into different types for better understanding:
Arithmetic Operators: ( +, -, *, %, / )
Increment or Decrement Operators: (++, -- ) [eg: a=10; a++, result: 10 + 1 = 11]
Assignment Operator: ( = )
Relational Operators: (>= , <= , > , < )
Comparison Operators: ( == )
Logical Operators: (&& , || )
Combination of variable and operator is called an Expression (E= V+O).
Eg: Z = X + Y;
Clarification: This is to simplify the above example in what it defines.
Variable : X,Y,Z.
Operator : +, =.
Delimiter : ;
// Variable Declaration Integer AgeOfJohn; Integer AgeOfSara; Integer SumOfAges; Integer AgeOfJohnAfter5Years; // Variable Initialisation AgeOfJohn = 24; AgeOfSara = 25; // Business Logic SumOfAges = AgeOfJohn + AgeOfSara; AgeOfJohnAfter5Years = AgeOfJohn + 5;
Result :
SumOfAges = 49 AgeOfJohnAfter5Years =29
Consider 2 variables, perform Addition & Multiplication of both the numbers.
// Variable Declaration Integer Product1; Integer Product2; Integer SumOfProducts; Integer MultiplicationOfProducts; // Variable Initialisation Product1 = 20; Product2 = 30; // Business Logic SumOfProducts = Product1 + Product2; TotalProducts = Product1 * Product2;
Result :
SumOfProducts = 50. TotalProducts = 600.
[Related Page: How A Salesforce Certification Can Boost Your Career]
Let us assume with a sample program of Addition & Multiplication:
// Variable Declaration Integer Product1; Integer Product2; Integer SumOfProducts; Integer MultiplicationOfProducts; // Variable Initialisation Product1 = 20; Product2 = 30; // Business Logic SumOfProducts = Product1 + Product2; TotalProducts = Product1 * Product2; // Output
Syntax - system.debug();
system.debug('The Sum = ' + SumOfProducts ); system.debug('The Multiplication = ' + TotalProducts );
Login to Salesforce Org → Click On the “UserMenu” → Select “Developer Console” → A new window opens → Click on (Ctrl + E) or (Open Execute Anonymus Window) → Paste the code and Click on Execute (Check the box “OpenLog” for log wise result). The button next to Execute is “Execute Highlighted” - If you need to execute some part of the code, you can select the Execute highlighted.
Program in the Salesforce Environment
The result is shown in a log based as shown in the below figure.
Program in the Salesforce Environment (a)
If you want to check only the OutPut and not all the log files, you need to select the “Debug Only” checkbox in the bottom line of the Execution Log.
Program in the Salesforce Environment(b)
In the next topics, we will discuss in detail about “”. Keep following us for more info on Salesforce Development / Programming.
Mindmajix offers different Salesforce certification training according to your desire with hands-on experience on Salesforce concepts
Free Demo for Corporate & Online Trainings.
Arogyalokesh
Arogyalokesh takes complex technical ideas and distills them into user-friendly visuals to improve digital marketing campaigns for companies. He is a Content Writer at Mindmajix spreading nuggets of content related to Technology. Proceeded to work in a fast upscale environment, assuring client delight in content writings