0019

Hello, World!

Basics
Easy
text

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): Text

Rules:

  • When Name is empty (''), return exactly Hello, World!.
  • Otherwise return Hello, <Name>! — for example, Greet('Taylor') returns Hello, 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.
ALBusiness Central 28.4
Press Compile to check your code compiles — Submit runs the tests.