top of page

Apex Decoder Ring

We all want to be Awesome Admins.

But, for anyone that fell in love with Salesforce and has no programming experience...Apex can be intimidating at first.

You need a Decoder Ring to figure it all out!

Here's some basics that I've put together that have really helped me get started with development.

​​

Example:

public class ThisIsTheClassName <-First Line of Class

{ <-Braces denote the beginning of a code block

Public ThisIsTheMethodName <-First Line of Method

{ <-Braces denote the beginning of a code block

YOUR CODE GOES HERE

} <-Braces denote the end of a code block (method)

} <-Braces denote the end of a code block (class)

Methods, Classes and Attributes - Oh my!

Attributes are characteristics of a class. Picture your home. A window, the door color, etc. are examples of attributes of your home.

Methods are things that a class can do. A home can shelter, store, protect, etc.

Governor limits ensure that everyone gets the same performance out of their Salesforce Org. What that means is that you need to be smart when creating triggers in your Org, so that you don't hit a limitation when your data is trying to process. Think of your home again. Someone uses the hot water for 2 hours. Will the person after get any hot water or has it all been used up? Limits protect us all and need to be carefully considered.

I've gotten started by reviewing existing code and working to understand the pieces. I've come across a few tips that have been helpful along the way:

  • Attribute names are typically nouns and start with a lowercase letter

  • Constants are capitalized & sometimes include an _

  • Methods are typically verbs & use camel case

  • Keywords have predefined actions and cannot be used as a name (ex. today)

  • Classes always start with an uppercase and are followed by curly braces

  • Statement: single line of code terminated by a semicolon

  • Block: includes multiple statements enclosed between curly braces

Some code examples can be found in the Developer library

Featured Posts
Recent Posts
Archive
Search By Tags
No tags yet.
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
Kelly Bentubo Salesforce Geeking Out
bottom of page