-
Notifications
You must be signed in to change notification settings - Fork 625
AL Code Documentation
For documentation hints, have a look at XML Documentation Comments.
Code documentation in AL is generated according to the XML-based code comments (///
) preceding an object or a procedure.
/// <summary>
/// My awesome codeunit
/// </summary>
Codeunit 42 "My awesome codeunit"
{
/// <summary>
/// Hello AL Documentation!
/// </summary>
procedure HelloALDocumentation()
begin
...
end;
}
The AL documentation guidelines are similar to the C# documentation. However, there are some minor differences so keep reading.
- <error>only in AL
- <example>
- <param>
- <paramref>
- <raises>only in AL
- <remarks>
- <returns>
- <see>
- <seealso>
- <summary>
<error>description</error>
description
- a summary of the error
Use this tag to provide a description of the error that a procedure might throw.
/// <summary>
/// My awesome name setter
/// </summary>
/// <param name=NewName>The name to set as my name</param>
/// <error>When the provided name is empty</error>
procedure SetMyName(NewName: Text)
begin
if NewName = '' then
Error('Oops! Cannot set an empty name.');
MyName := NewName;
end;
See the <example> documentation.
See the <param> documentation.
See the <paramref> documentation.
<raises>description</raises>
description
- a summary of the raised event
Use this tag to provide a description of the event that a procedure might raise.
/// <summary>
/// My awesome name getter
/// </summary
/// <raises>OnAfterGeMyName</raises>
/// <returns>My name</returns>
procedure GetMyName() Name: Text
begin
Name:= MyName;
OnAfterGeMytName(Name);
end;
/// <summary>
/// Integration event, raised from <see cref="GetMyName"/>.
/// Subscribe to this event to modify the returned name.
/// </summary>
[IntegrationEvent(false, false)]
local procedure OnAfterGetMyName(var Name: Text)
begin
end;
See the <remarks> documentation.
See the <returns> documentation.
See the <see> documentation.
See the <seealso> documentation.
See the <summary> documentation