Home

How to solve Apex Class error 100?

Alton Alexander
By Alton AlexanderUpdated on June 4th, 2022

"Code 100 Apex" is an error that can occur when using the Salesforce Apex programming language. This error typically occurs when there is a problem with the syntax of the Apex code, or when the Apex code is trying to perform an operation that is not allowed.

You are here because you have a question about:

  • apex error code 100
  • code 100 apex

1. Check that all lines of code are properly indented

There are a few different ways to check that all lines of code are properly indented in order to fix code 100 apex. One way is to use a code editor like Sublime Text, Atom, or Vim and use the "indent" command to properly indent each line. Another way is to use a code formatter like Reformat Code or JSHint and check that all lines of code are properly indented.

2. Use proper casing for all keywords

  1. Use the proper suffix for all keywords.
  2. Use the proper capitalization for all keywords.
  3. Use the proper spelling for all keywords.
  4. Use the proper prefix for all keywords.

3. Declare all variables before using them

  1. Declare the variable you wish to use
  2. Set the variable's type
  3. Assign the value to the variable
  4. Use the variable

4. Use white space to improve readability

There are a few guidelines that can be followed to improve code readability by using white space:

  1. Use consistent white space throughout the code.
  2. Use a consistent font size and typeface throughout the code.
  3. Use a consistent indentation level throughout the code.
  4. Use a consistent line length throughout the code.
  5. Use a consistent block structure throughout the code.

If the answers above didn't work then you should also try:

  1. Follow the recommended naming conventions
  2. Use comments to document code
  3. Remove unused code
  4. Use a code linter to check for errors