Esercizio - Creazione dell'oggetto tabella Gestione estensioni premi clienti
Scenario
La tabella Gestione estensioni premi clienti permette di archiviare informazioni sulla codeunit da usare per gestire gli eventi nell'estensione, in modo da poter creare eventi fittizi nel test di esempio.
La tabella è composta da due campi:
Chiave primaria
ID codeunit Gestione estensione Premi cliente
Creazione dell'oggetto tabella Gestione estensioni premi clienti
Creare un nuovo file .al.
Per creare una nuova tabella nell'estensione, creare prima un nuovo file selezionando il pulsante Nuovo file nella barra laterale di Visual Studio Code.
Assicurarsi che il nome del file termini con .al. In questo esempio si potrebbe usare il nome CustomerRewardsMgtSetup.Table.al.
Aggiungere il codice alla tabella. È possibile copiare il codice che segue e incollarlo nel file CustomerRewardsMgtSetup.Table.al.
table 50102 "Customer Rewards Mgt Setup"
{
Caption = 'Customer Rewards Mgt. Setup';
DataClassification = CustomerContent;
fields
{
field(1; "Primary Key"; Code[10])
{
Caption = 'Primary Key';
DataClassification = CustomerContent;
}
field(2; "Cust. Rew. Ext. Mgt. Cod. ID"; Integer)
{
Caption = 'Customer Rewards Ext. Mgt. Codeunit ID';
DataClassification = CustomerContent;
//TableRelation = "CodeUnit Metadata".ID;
}
}
keys
{
key(PK; "Primary Key")
{
Clustered = true;
}
}
}
Poiché l'oggetto cui è collegato TableRelation non esiste ancora, il compilatore restituirà un errore su questa riga. Per rimuovere l'errore, è stato temporaneamente aggiunto un commento a TableRelation.