Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Assistance adding actions to page

(0) ShareShare
ReportReport
Posted on by 13
Hello Community,
 
I am working on a custom page where I would like to add actions. I cannot get the code to compile. I get AL0198 among other errors. I have provided the code for the page as well as another example page where I got actions working. Any assistance is appreciated. 
 
page 62802 OpenPoTableJobItem
{
    Caption = 'Open PO Report (Job)(Item)';
    PageType = List;
    UsageCategory = Lists;
    ApplicationArea = All;
    SourceTable = OpenPoTableJobItem;
    Editable = false;
    SaveValues = false;
    SourceTableView = sorting(/Expected Receipt Date/, /No./, INXPOLine);
 
    layout
    {
        area(Content)
        {
            repeater(Group)
            {
                field(RowNo; Rec.RowNo)
                {
                    ApplicationArea = All;
                }
                field(/Purchase Order/; Rec./No./)
                {
                    ApplicationArea = All;
                }
                field(INXPOLine; Rec.INXPOLine)
                {
                    ApplicationArea = All;
                }
                field(/Job No./; Rec./Job No./)
                {
                    ApplicationArea = All;
                }
                field(Quantity; Rec.Quantity)
                {
                    ApplicationArea = All;
                    Caption = 'QTY Ordered';
                    DecimalPlaces = 0;
                }
                field(/Quantity Received/; Rec./Quantity Received/)
                {
                    ApplicationArea = All;
                    Caption = 'QTY Received';
                    DecimalPlaces = 0;
                }
                field(/No./; Rec./TypeNo./)
                {
                    ApplicationArea = All;
                }
                field(Description; Rec.Description)
                {
                    ApplicationArea = All;
                }
                field(/Promised Receipt Date/; Rec./Promised Receipt Date/)
                {
                    ApplicationArea = All;
                }
                field(/Expected Receipt Date/; Rec./Expected Receipt Date/)
                {
                    ApplicationArea = All;
                    StyleExpr = StyleExprTxt;
                }
                field(/Buy-from Vendor Name/; Rec./Buy-from Vendor Name/)
                {
                    ApplicationArea = All;
                }
                field(Name; Rec.Name)
                {
                    ApplicationArea = All;
                }
                field(inxPOrec; Rec./inxPOrec/)
                {
                    ApplicationArea = All;
                }
                field(INXComment; Rec.INXComment)
                {
                    ApplicationArea = All;
                }
            }
        }
    }
 
    trigger OnOpenPage()
    var
        PurchaseOrderQuery: Query /openPoQueryA/;
    begin
        if PurchaseOrderQuery.Open() then begin
            while PurchaseOrderQuery.Read() do begin
                Rec.Init();
                Rec.RowNo := Rec.RowNo + 1;
                Rec./No./ := PurchaseOrderQuery.PHponumber;
                Rec.INXPOLine := PurchaseOrderQuery.PLlinenumber;
                Rec./Buy-from Vendor Name/ := PurchaseOrderQuery.PHvendor;
                Rec.Description := PurchaseOrderQuery.PLlinedesc;
                Rec.INXComment := PurchaseOrderQuery.PLcomment;
                Rec.inxPOrec := PurchaseOrderQuery.PLdelivered;
                Rec./Promised Receipt Date/ := PurchaseOrderQuery.PLpromiseddate;
                Rec./Expected Receipt Date/ := PurchaseOrderQuery.PLexpecteddate;
                Rec./Job No./ := PurchaseOrderQuery.PLjobno;
                Rec./TypeNo./ := PurchaseOrderQuery.PLTypeno;
                Rec.Quantity := PurchaseOrderQuery.PLqtyordered;
                Rec./Quantity Received/ := PurchaseOrderQuery.PLqtyreceived;
                Rec.Name := PurchaseOrderQuery.REbuyer;
                Rec.Insert();
            end;
            PurchaseOrderQuery.Close();
            rec.FindFirst()
        end;
    end;
 
    trigger OnAfterGetRecord()
    begin
        If Rec./Expected Receipt Date/ < WorkDate() then
            StyleExprTxt := 'Unfavorable'
        else
            If Rec./Expected Receipt Date/ > WorkDate() then
                StyleExprTxt := 'Favorable'
            else
                StyleExprTxt := 'None'
    end;
 
    var
        StyleExprTxt: Text;
}
 
 
page 62805 PageName
{
    PageType = List;
 
    actions
    {
        // Adds the action called /My Actions/ to the Action menu
        area(Processing)
        {
            action(/Nonjob (active)/)
            {
                Promoted = true;
                PromotedCategory = Process;
                ApplicationArea = All;
                RunObject = page 62802;
                Image = SelectReport;
            }
        }
    }
}
  • jack Profile Picture
    13 on at
    Assistance adding actions to page
    Mohana,
     
    Thanks for your response. I determined the resolution was to place the code in the layout section. This is resolved.
  • Verified answer
    Mohana Yadav Profile Picture
    60,209 Super User 2025 Season 1 on at
    Assistance adding actions to page
    Can you paste the error text as well?
    It should contain the Line and Column details.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,135 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,871 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans