Hello, World!
Every AL journey starts with a codeunit. Write one that greets the world — and anyone else who introduces themselves.
Requirements
Create a codeunit named "Hello World" with a public procedure:
procedure Greet(Name: Text): TextRules:
- When
Nameis empty (''), return exactlyHello, World!. - Otherwise return
Hello, <Name>!— for example,Greet('Taylor')returnsHello, Taylor!.
What the tests check
The grading tests call Greet with an empty string, a fixed name, and a randomly generated name, and compare the result exactly — note the comma, the space, and the exclamation mark.
Learn More
Hint 1
The shell you need:
codeunit <id> "Hello World" { } with the procedure inside.Hint 2
A procedure returns its value with
exit(...).Hint 3
Handle the empty name first:
if Name = '' then exit('Hello, World!'); — then exit the personal greeting built with the + text concatenation operator. Press Compile to check your code compiles — Submit runs the tests.