Skip to main content
TrailblazerDX, the ultimate AI learning event is heading back to San Francisco March 6-7, 2024. Register Now and save 35% with code T24DEYE424.

Invoke and Test the Code

Run the Code

An anonymous block is Apex code that does not get stored, but can be compiled and executed on demand right from the Developer Console. This is a great way to test your Apex Classes or run sample code.

  1. In the Developer Console, select Debug | Open Execute Anonymous Window.
  2. In the Enter Apex Code window, enter the following:
  3. At the bottom right, click Execute.
Keep learning for
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities