December 2018
Intermediate to advanced
764 pages
31h 47m
English
Typing the shortcut ttableextension will create the basic layout for a table extension object when using the AL language extension.
The following is an example of a table extension object that extends the Customer table object by adding a ShoeSize field:
tableextension 50115 RetailWinterSportsStore extends Customer
{
fields
{
field(50116;ShoeSize;Integer)
{
trigger OnValidate();
begin
if (rec.ShoeSize < 0) then
begin
message('Shoe size not valid: %1', rec.ShoeSize);
end;
end;
}
}
procedure HasShoeSize() : Boolean;
begin
exit(ShoeSize <> 0);
end;
trigger OnBeforeInsert();
begin
if not HasShoeSize then
ShoeSize := Random(42);
end;
}
Extension objects can have a name with a maximum length of 30 characters.
Read now
Unlock full access