Disclaimer: These guidelines are in development and might change over time.
For documentation hints, have a look at XML Documentation Comments.
Overview
Code documentation in AL is generated according to the XML-based code comments (///
) preceding an object or a procedure.
Example
/// <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.
Supported tags
- <error>only in AL
- <example>
- <param>
- <paramref>
- <raises>only in AL
- <remarks>
- <returns>
- <see>
- <seealso>
- <summary>
Syntax
<error>description</error>
Parameters
description
- a summary of the error
Remarks
Use this tag to provide a description of the error that a procedure might throw.
Example
/// <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.
Syntax
<raises>description</raises>
Parameters
description
- a summary of the raised event
Remarks
Use this tag to provide a description of the event that a procedure might raise.
Example
/// <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.
<summary>
See the <summary> documentation