Salesforce Development

(4.9)
1984 Viewers

You landed on this tutorial because, frankly, there aren't enough guides out there that cover all the Salesforce Development fundamentals in one go. So here it is  Apex programming from scratch, control flow (conditionals, loops, all of it), the three collection types you'll actually use every day (List, Set, Map), and a proper breakdown of shallow copy vs deep copy. We threw in code examples throughout that you can copy straight into your Developer Console and test.

Salesforce Development
  • Blog Author:
    Kalla SaiKumar
  • Last Updated:
    09 May 2026
  • Views:
    1984
  • Read Time:
    6:55 Minutes
  • Share:
Salesforce Articles

Possibly, most people still think of Salesforce as a CRM. And sure, it started that way. But at this point? It's a full development platform. There's an entire programming language baked into it  Apex  and that language is what makes the really interesting stuff possible.

You've probably already played around with the no-code side of things. Workflows, Flows, Process Builder. They work. For basic automation, these are all fine. 

But here's where it falls apart. A client shows up and says: "Hey, whenever someone creates a Contact under one of our enterprise Accounts, we need the system to ping an external credit-check API, calculate a discount based on where the Account is located, and then auto-create a Task for the rep who owns the Account." That's a real requirement, by the way  you might see variations of it on at least three different projects. 

And that's really the point of this whole tutorial. We're going to walk through everything from the ground floor  what Apex is and how you actually write it, how you get your code to make decisions and repeat operations, how the three main collection types work (you'll use these daily, I promise), and then we'll close out with shallow copy vs deep copy. That last one, honestly, most developers don't bother learning properly until they've wasted half a day chasing a bug that turned out to be a shared object reference. Save yourself the trouble and learn it now.

Table of Content:

  • Apex Programming

What is Apex Programming

Apex is the programming language which Salesforce designed for their platform. Since it is object-oriented as well as strongly typed and runs server-side, your code would execute on Salesforce's infrastructure. It means that your Apex code can talk directly to the database, access the logged-in user's info, read org metadata. It can do these  all without configuring connection strings or standing up middleware. It just works out of the gate, which is honestly one of the nicer things about developing on this platform.

Anyone with a Java background is going to pick this up fast. 

The syntax is very similar. Classes, methods, instance variables, loops, try-catch  you'll recognize all of it. 

However, it is different in the runtime environment. Salesforce is multi-tenant, meaning your organisation can share server resources with different other organisations. Hence, they have put strong limitations on what your code can do within a single execution. It includes elements like 

  • how many SOQL queries you can fire, 
  • how many DML statements you can run, 
  • how much heap memory you can use.

These caps have the name "governor limits," and the whole reason they exist is to stop one user’s weakly optimized code from dragging down performance for others on the same server cluster.

Apex Data Types:

Talking about the data type, Apex includes 

  • Integer,
  • String,
  • Boolean,
  • Double,
  • Long,
  • Date,
  • Datetime,
  • and Blob.

So, if you have used any C-based language, you would feel comfortable with these.

The thing that will feel new and this is genuinely cool if you're coming from Java or Python  is sObjects. 

An sObject is a direct and in-memory representation of an actual Salesforce record. So, when you type Account acc = new Account(); and start setting fields on it, you are building a database row in code. Call insert acc; and that object becomes real data sitting in your org. The first time you do that, it will click immediately why people like building on this platform.

Variable declarations look like this in practice:

apex

Integer headcount = 120;
String companyName = 'Zenith Solutions';
Boolean isVerified = true;
Double totalRevenue = 3400000.50;
Date joinDate = Date.newInstance(2022, 6, 10);

And here's how you work with an sObject:

apex

Account newAccount = new Account();
newAccount. Name = 'Orion Technologies';
newAccount. Industry = 'Healthcare';
newAccount.AnnualRevenue = 5000000;

That Account object is ready to be inserted into the database whenever you run a DML insert statement.

How To Run An Apex Code?

The easiest and quickest way to run Apex code is through the Developer Console.

  • You go to Setup, 
  • click the gear icon at the top right,
  • open Developer Console.
  • Next, go to Debug > Open Execute Anonymous Window.
  • You can also just press Ctrl+E once the console is open.
  • Paste your code in and hit Execute. 
  • Then check the Logs tab at the bottom  filter by "DEBUG" to see your output.
apex

String msg = 'First line of Apex - feels good.';
System.debug(msg);

Integer x = 8;
Integer y = 13;
System.debug('Total: '+ (x + y));

System.debug() is how you print output in Apex. There's no console.log or System.out.println here  it's all System.debug(), and you read the results in the debug log.

That covers the basics. If you want a more thorough understanding of Apex fundamentals with hands-on labs, MindMajix's Salesforce Development training program covers this and a lot more.

Now let's see how you can control what your code does and when it does it.

logoOn-Job Support Service

Online Work Support for your on-job roles.

jobservice
@Learner@SME

Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:

  • Pay Per Hour
  • Pay Per Week
  • Monthly
Learn MoreContact us
Course Schedule
NameDates
Salesforce TrainingMay 12 to May 27View Details
Salesforce TrainingMay 16 to May 31View Details
Salesforce TrainingMay 19 to Jun 03View Details
Salesforce TrainingMay 23 to Jun 07View Details
Last updated: 09 May 2026
About Author

Kalla Saikumar is a technology expert and is currently working as a Marketing Analyst at MindMajix. Write articles on multiple platforms such as Tableau, PowerBi, Business Analysis, SQL Server, MySQL, Oracle, and other courses. And you can join him on LinkedIn and Twitter.

read less