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.
- In the Developer Console, select Debug | Open Execute Anonymous Window.
- In the Enter Apex Code window, enter the following:
- At the bottom right, click Execute.