Table 8008 Imported Subscription Header

Subscription Billing, Microsoft.SubscriptionBilling

src/Apps/W1/Subscription Billing/App/Import/Tables/ImportedSubscriptionHeader.Table.al150 lines, Copyright (c) Microsoft Corporation. MIT

namespace Microsoft.SubscriptionBilling;using Microsoft.CRM.Contact;using Microsoft.Inventory.Item;using Microsoft.Sales.Customer;using System.Security.User;table 8008 "Imported Subscription Header"{    DataClassification = CustomerContent;    Caption = 'Imported Subscription Header';    fields    {        field(1; "Entry No."; Integer)        {            Caption = 'Entry No.';            AutoIncrement = true;            NotBlank = true;        }        field(2; "Subscription Header No."; Code[20])        {            Caption = 'Subscription No.';            TableRelation = "Subscription Header";            ValidateTableRelation = false;        }        field(3; "End-User Customer No."; Code[20])        {            Caption = 'Customer No.';            TableRelation = Customer;        }        field(4; "Bill-to Customer No."; Code[20])        {            Caption = 'Bill-to Customer No.';            NotBlank = true;            TableRelation = Customer;        }        field(5; "Bill-to Contact No."; Code[20])        {            Caption = 'Bill-to Contact No.';            TableRelation = Contact;        }        field(6; "Ship-to Code"; Code[10])        {            Caption = 'Ship-to Code';            TableRelation = "Ship-to Address".Code where("Customer No." = field("End-User Customer No."));        }        field(7; "Item No."; Code[20])        {            Caption = 'Item No.';            TableRelation = Item where("Subscription Option" = filter("Sales with Service Commitment" | "Service Commitment Item"));            trigger OnValidate()            var                Item: Record Item;            begin                if Description = '' then                    if "Item No." <> '' then begin                        Item.Get("Item No.");                        Description := Item.Description;                    end;            end;        }        field(8; Description; Text[100])        {            Caption = 'Description';        }        field(10; "Customer Reference"; Text[35])        {            Caption = 'Customer Reference';        }        field(11; "Serial No."; Code[50])        {            Caption = 'Serial No.';            trigger OnValidate()            begin                if ("Quantity (Decimal)" <> 1) and ("Serial No." <> '') then                    Error(SerialQtyErr);            end;        }        field(12; Version; Text[100])        {            Caption = 'Version';        }        field(13; "Key"; Text[100])        {            Caption = 'Key';        }        field(14; "Provision Start Date"; Date)        {            Caption = 'Provision Start Date';        }        field(15; "Provision End Date"; Date)        {            Caption = 'Provision End Date';        }        field(16; "End-User Contact No."; Code[20])        {            Caption = 'Contact No.';            TableRelation = Contact;        }        field(17; "Unit of Measure"; Code[10])        {            Caption = 'Unit of Measure';            TableRelation = "Item Unit of Measure".Code where("Item No." = field("Item No."));        }        field(19; "Quantity (Decimal)"; Decimal)        {            Caption = 'Quantity';            InitValue = 1;            AutoFormatType = 0;            DecimalPlaces = 0 : 5;        }        field(100; "Subscription Header created"; Boolean)        {            Caption = 'Subscription created';            Editable = false;        }        field(101; "Error Text"; Text[250])        {            Caption = 'Error Text';            Editable = false;        }        field(102; "Processed by"; Code[50])        {            Caption = 'Processed by';            DataClassification = EndUserIdentifiableInformation;            TableRelation = "User Setup";            Editable = false;            ValidateTableRelation = false;        }        field(103; "Processed at"; DateTime)        {            Caption = 'Processed at';            Editable = false;        }    }    keys    {        key(PK; "Entry No.")        {            Clustered = true;        }    }    var        SerialQtyErr: Label 'Only Subscriptions with quantity 1 may have a serial number.';}