Hello, ApexSensei
Write Apex · Beginner · 5 min · Runs in your Salesforce Developer org · Free
Scenario. Confirm that your Salesforce connection can compile, execute, and return one clear log line.
Run your first Apex statement in Salesforce and read its labeled debug output.
What you will learn
Apex runs on Salesforce servers, so developers inspect values with System.debug(). Text uses single quotes and every statement ends with a semicolon.
String status = 'Ready';
System.debug('Status: ' + status);
Gotcha. Debug output helps developers; Salesforce users do not see it.
The task
Set the greeting and print it with the label Greeting:.
Examples:
- greeting
Hello, ApexSensei!→Greeting: Hello, ApexSensei! - greeting
Welcome→Greeting: Welcome
Requirements:
- Set
greetingtoHello, ApexSensei!. - Print
Greeting:plus the variable withSystem.debug. - Build the line from the
greetingvariable. Don't type the whole line as one piece of text.
Starter code
String greeting = null;
When it passes
The log shows one debug line: `Greeting: Hello, ApexSensei!`
You write the Apex yourself. ApexSensei runs it and tells you what passed and what did not.
‹ Comments that survive review · Quick win: double a number ›