Salesforce provides two modules, one is admin module and the other is developer module. A Salesforce developer can execute code and customize 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 the conjunction of calls to the API. It is similar to Java and performs 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.
Basically, we have 2 different modules in Salesforce:
Let us look into a few scenarios where coding is important than the administration in Salesforce.
Hint: WFR(workflow rule).
Hint: It is not possible in the 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 the 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, whereas 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 a 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 future use.
Note: Every variable is first declared with the type of data it’s going to store. It is mandated 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 on the programming is quite common to understand what the statement specifies.
Comment can be given to a single line or group of lines together.
Operators are the symbols which operate 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;
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;
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
system.debug('The Sum = ' + SumOfProducts ); system.debug('The Multiplication = ' + TotalProducts );
Log in 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 “Controlling the program flow in Salesforce”. 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
|Salesforce Administration Training||Salesforce Lightning Training|
|Salesforce Advanced Developer Training||Salesforce Developer Training|
|Salesforce IoT Training||Salesforce App Builder Certification Training|
|Salesforce AppExchange Training||Salesforce Service Cloud Training|
|and many more.|
Free Demo for Corporate & Online Trainings.