hougaard / Youtube-Video-Sources

All the source code from my Youtube videos
https://youtube.com/c/ErikHougaard
163 stars 98 forks source link

Missing POS Setup Table #3

Open acrespo123 opened 2 years ago

acrespo123 commented 2 years ago

Hi Hougaard,

I tried to run the code in the latest version of Business Central.

It always stop in this point image

And return this error on Business Central image

The POS Setup Table exist on code but not in BC.

thank you

hougaard commented 2 years ago

There is a POS Setup page, use that.

acrespo123 commented 2 years ago

It is in the project, but dont work

Page 1000000 "POS Setup"
{
    Caption = 'POS Setup';
    SourceTable = "POS Setup";
    UsageCategory = Administration;
    ApplicationArea = All;

    layout
    {
        area(Content)
        {
            field("Cash Customer"; Rec."Cash Customer")
            {
                ApplicationArea = All;
                ToolTip = 'Cash Customer';
            }
        }
    }

    trigger OnOpenPage()
    begin
        if Rec.IsEmpty() then
            Rec.Insert();
    end;
}
table 1000000 "POS Setup"
{
    Caption = 'POS Setup';

    fields
    {
        field(1; POSKEY; Code[10])
        {
            DataClassification = SystemMetadata;
        }
        field(13; "Cash Customer"; Code[20])
        {
            Caption = 'Cash Customer';
            TableRelation = Customer."No.";
        }
    }
}