Apex Learning Journal #4 – How To Practice Apex

Written Date: August 30, 2021

“YAY I GOT THE CERTIFICATE!!…… but what next?”

…is the feeling I have whenever I finish an exam. Though getting the certificates is important, how to actually utilize the knowledge in our daily work is also critical. After all, if we don’t use it, we will forget about it.

I can always find good opportunities to practice other skills, but practicing Apex is really bugging me. The reason is that when working in a non-developer position, it’s unlikely we will work with Apex daily. I also can’t find good and “simple” use cases where Apex is preferred over Flow (If you have something, please share with us).

Luckily, I have found some ideas and resources that have helped me, and I hope these will help you too!

  1. Study Notes
  2. Learning Path
  3. Summary

1. Build A Utility Class For Testing Flows

Unlike Apex, Flow doesn’t provide the unit test framework. We can use the Debug button to test the flow on a single record, but when it comes to testing records in bulk, we can only do it in the actual environment. So instead of creating a fake file and upload it every time, I started to write Apex codes that create/update/delete many records. Example looks like this:

  List<Account> accList = new List<Account>();
        for (integer i = 0; i < 100; i ++){
            Account acc = new Account(
            Name = 'TestAccount'   
        insert accList;

At first I ran the entire code in the Anonymous Window, then I found out that I “copy and paste” too much when I need different actions. This gave me the idea that I should write these as methods and put them in a class. I want to mention this because I have known about classes and methods for 3-4 years, but I have never truly been convinced about the importance of the structure (If I am only using the codes one time – why bother to write class?).

Now that I have experienced the “pain” of copy and paste, I will always try to maintain a good code structure with classes and methods. This is a very major realization of my coding journey.

I use testing flows as example because I build flows a lot, but what I am really suggesting is to first identify your repetitive tasks that you need to do from the backend, and try writing codes to simplify the process. With Apex and the developer console, you can use the codes in a few clicks and check the execution log right away. It has helped me save so much time and I really recommend trying out this idea (In Sandbox or Developer Org!)

2. Find An Interesting Problem To Solve

Practicing is draining, so at least find a problem that is motivating! Here are some places you can find some challenge problems

Apex Step By Step – Topics For Practice:

I came across this site and I think it’s amazing. You can find some practice examples for triggers or async apex (Locate the Topics For Practice section and click on the icons). I love how it provides the solutions to both the triggers and the test classes, and they are hidden until you decide to check the answer. There are not that many examples at the moment, but can definitely keep you busy for a while.

SF99 – Coding Challenges:

There are only five challenges, but I think they are quite interesting – especially the ones you have to identify the errors.


Totally unrelated to Salesforce and Apex, yet my all time favorite coding practice site because there are so many fun questions. Even though it’s not related to Salesforce, but it does help your programming skills. The downside though is that there is no official answer for each question.

3. Convert The Flows Into Apex

If none of the above methods works for you, trying to convert flows into Apex might be the last resort. Please note that I don’t mean that you should migrate the flows into Apex. I simply mean you can “practice” how to code in Apex based on a flow solution. The logic for flow building is very similar to Apex building, so if you are proficient in Flow, this would be a great idea to help you familiarize with Apex syntax.

Do you have any other methods that have helped you learn Apex efficiently? Share with us so they can help the community too!

  • It is important to continue practicing Apex even after the certificate
  • For non-developers, you can practice Apex in the following ways:
    • Build utility classes for testing flows or other repetitive tasks in the backend
    • Find exciting puzzles to solve using Apex:
    • Practice to convert a flow into Apex

Want to learn Flow? Check Out Flow Use Cases Or Write Us One!

Notify of

1 Comment
Newest Most Voted
Inline Feedbacks
View all comments
Jenni Gibb

Our developer at my job creates beautiful flow screen Lightning components for my screen flows. The use case has been to present the user with a search module, and allow them to select one or more records from the results. The output is a list of IDs that I then handle with loops in the flow.