Apex Learning Journal #1 – Starting with Java
Written Date: June 21, 2021
Hello Flowsome people! If you have followed this blog for a while, you might have noticed that I just love Flow so much. However, in order to have a complete overview of Salesforce automation, recently I have decided to start learning Apex. I know this a difficult path, so I want to write down my learning journey and hope it will be helpful for those who also want to learn to code in Apex. Let’s kickstart this series with the first episode – learning Java!
Since this is the first journal, I want to share why I want to start learning Apex, what is my studying style, and what I have already known. Customize the learning path to fit your needs better.
CONTENTS
I have been wanting to learn more about the Salesforce foundation for a while. I know it’s built with Apex, which is a Java-like language. However, even though I am interested in programming, I never see myself become a full-time developer (not to mention a Java developer). Thus I am worried that it won’t provide many benefits if I learn Java or Apex. Either I am tied to these specific languages, or I will forget about them soon after.
Then, I came across this AMAZING video by Codecademy. Now I realize even though I might forget about the syntax, the training of logical thinking will stay with me forever. I finally got the motivation to start learning!
I didn’t have the whole path plotted out, but there are some huge milestones that I want to achieve:
- Code in Apex proficiently
- Have the full overview of Salesforce automation
- Get the Platform Developer I certificate
They don’t have to be in a specific order and there might be other steps involved too, so at the end of each journal I will summarize my current step and next step.
To help you decide whether the series is relevant to you, I want to introduce myself a bit. The two most important factors in my opinion are: What type of learner I am and what I know already.
WHAT TYPE OF LEARNER I AM
If I use one word to summarize myself, it will be Impatient. I find things boring easily and can’t really focus for a long time. The good side of being impatient though is that I am also highly efficient. I want to learn things in the fastest way possible, so I like the learning content to be in bullet points.
I also learn better by doing, so I always look for many hands-on practice and real-world examples.
Finally, I want to and need to understand EVERYTHING. The feeling of not understanding bothers me very much. If you ask me to use something that I don’t fully comprehend, it won’t stick to my head and I will just freak out. If you are like me, this series should be very helpful for you.
WHAT I KNOW ALREADY
Salesforce-wise, I am pretty proficient with the declarative automation tools (Flow/Process Builder/Workflow). I know a little Visualforce syntax from my previous admin job. I am able to modify the existing scripts, but not build them from scratch.
Programming-wise, I can write Python and SQL to solve puzzles, but not to the level of building programs. I also know a bit about Html/CSS, but I mostly just google, copy, and paste.
To sum up, I know a bit about programming, but am pretty good at logic. It’s ok if you don’t know programming either, but if you consider yourself not that strong in logic, I recommend getting familiar with Flow first before you start with Apex. (It really helps!)
The first resource I found is the fantastic SF99 blog by David Liu. There are many free materials and a well-planned course schedule. However, when I started the first lesson, this is something similar to what I saw:
trigger XXX on Lead (before insert){
for (Lead l : Trigger.New){
l.name = 'Test';
}
}
I was like: WHAT?!
There are so many things I didn’t understand. Why is there a “trigger” in the beginning? Why colons and semicolons? What is Trigger.New?…. Since I need to know everything, I spent one hour searching on the syntax, and another hour reading on the context variable (Trigger.New). Then I knew it’s not going to work for me. I needed other resources that can answer all my questions from the beginning.
Then I tried the Apex Basic modules on Trailhead, but that was no luck either. I saw a bunch of this:
String varName = 'XXXXX';
OKAY. I know this is declaring a variable, but why is there a “String” in the beginning? In Python, you simply type Variable = “XXX”. What does that “String” mean? Then I saw something that’s even worse:
Account acc = New Account();
List<Account> listAcc = New List<Account>();
Account[] = New Account[3];
I immediately knew it wasn’t working either. It just got me more and more confused. I needed some content that explains every single detail of the syntax, so I don’t have to force-memorize them. I tried to search for this type of Apex courses but failed to find any good ones for me.
Then I thought, ok, since people always say it’s a Java-like language, what if I start with Java? Then boom! I found this great course on Codecademy that is teaching basic Java. I only used the free version, but that’s more than enough. There were so many “AHA!” moments where things just started to make sense. Now I understand the “String”, the colon/semicolon, and all the weird Apex codes I saw earlier. PERRRRFECT!
To summarize, if you are ok with using something that you temporarily don’t know yet, David’s courses and Trailhead modules could be a good start for you. But if you are just like me who needs to comprehend things before you could memorize them, I highly recommend learning basic Java first.
- The goal is to have the full overview of Salesforce automation tools by learning Apex
- The series is for people who are also impatient learners that always look for the most efficient methods
- Being proficient in the declarative tools and having some basic programming knowledge would help shorten the learning time, but being strong in logic is more important
- For people who need to understand every single detail, start with learning Java before Apex
- The basic Java course on Codecademy works great if you like practicing while learning
These are some random thoughts in the learning for my own reference. Feel free to leave a comment for any of the items:
- Can I use Apex to code Flow? Perhaps we can write some Flow Wizard with Apex to help people kickstart?
Want to learn Flow? Check Out Flow Use Cases Or Write Us One!
You are off to a good start. Many of the best flow extension actions are written in Apex. They make a great one-two punch.
Thanks Eric. Really looking forward to when I can write something cool for Flow myself!
Well done Melody, that is very clever from you 😀
Thank you :D!
Really interesting post, I also struggled while looking at the “basic” apex trailheads – but WHAT is that? Having a javascript background the syntax really bugged me since I didn’t understand what was going on. Thanks for your tips! I will take a look at java beforehand.
Totally agree on the “What is that” part! I have experience with Python, so the Apex syntax really bugged me too! However everything becomes so clear once I finished the Java course. Good luck Carla!!
Hi Melody,
I will follow your journey, I saw my story in your post. I really want to learn to program on Salesforce, but completely lost on how to.
I tried Davis Liu and trailhead like you, but it didn’t work. I will go for this Java course you mentioned and wait for your following posts!
That’s nice to hear. Good luck Livia and we can do this together!
Thank you so much for such a detailed post. Your post is what I was looking for.
Thanks a bunch, I’ll learn Java first and then go for Apex.
My pleasure Ahmad! Good luck with the learning and feel free to reach out if you want to discuss anything:)