Exercise - Create the Activation Code Information table object
Scenario
The Activation Code Information table is used for storing activation information for the extension. The table consists of three fields:
ActivationCode
Date Activated
Expiration Date
Create the Activation Code Information table object
Create a new .al file.
To create a new table in your extension, first create a new file by selecting the New File button in the side bar of Visual Studio Code.
Make sure that the file name ends with .al. In this example, you might want to use the name ActivationCodeInformation.Table.al.
Add the code to the table. You can copy the following code and paste it in the ActivationCodeInformation.Table.al file.
table 50101 "Activation Code Information"
{
Caption = 'Activation Code Information';
DataClassification = SystemMetadata;
fields
{
field(1; ActivationCode; Text[14])
{
Caption = 'Activation Code';
DataClassification = SystemMetadata;
Description = 'Activation code used to activate Customer Rewards';
}
field(2; "Date Activated"; Date)
{
Caption = 'Date Activated';
DataClassification = SystemMetadata;
Description = 'Date Customer Rewards was activated';
}
field(3; "Expiration Date"; Date)
{
Caption = 'Expiration Date';
DataClassification = SystemMetadata;
Description = 'Date Customer Rewards activation expires';
}
}
keys
{
key(PK; ActivationCode)
{
Clustered = true;
}
}
}