
上QQ阅读APP看书,第一时间看更新
Developer console exercises
We'll be using the developer console throughout this book, so it is necessary that you become familiar with it. The following are some exercises to help you familiarize with the consoles development features:
- Create a class: Using the developer console, create a new class and give it the name
DevConsoleExample
. Ensure that the class compiles without errors. - Run a SOQL query: Run a SOQL query from the query editor, that finds all the opportunities that are on the closed/won stage.
- Execute anonymous: Run the following code block in execute anonymous window:
System.assert(1, (1/0), 'should throw an assertion error');
- Log viewing: Having run that snippet of Apex in the developer console, navigate to the Logs tab and open the raw log option of its execution. Does the code throw assertion exception or division by 0 exception?