web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

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

In a pageextension, how to get a value from its parent page does not have a source table?

(0) ShareShare
ReportReport
Posted on by 15

Hello.

I'm trying to make a pageextension. Its parent page does not have sourcetable. 

I want to make a report print button in the page and get a package no in the page as a filter (reference record).

I cannot find a way to get a value from the page without source table. 

Is it possible in Business Central?

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi antiqua ,

    can you please show us your pageextension AL code?

  • antiqua Profile Picture
    15 on at

    Hi Verma,

    If a parent page has source table, as I know, I can use like CS_PackageNo.SetRange(CS_PackageNo."No.", Rec."No.");

    But it comes syntax error. So, I tried like "CurrPage.GetRecord(CS_PackageNo);" and CS_PackageNo.SetRange(CS_PackageNo."No.", CS_PackageNo."No.");

    Of course, it has no luck.

    Here is the code.

    pageextension 70138 PackLineScanningPageExt extends "LAX Pack Line Scanning RTC"

    {

       layout

       {

       }

       actions

       {

           addafter(Printing)

           {

               action(CS_PackingList)

               {

                   ApplicationArea = All;

                   Caption = 'Print Packing List';

                   ToolTip = 'Print Packing List';

                   Image = PrintChecklistReport;

                   trigger OnAction()

                   var

                       CS_PackageNo: Record "LAX Package";

                   begin

                       CurrPage.GetRecord(CS_PackageNo);

                       CS_PackageNo.SetRange(CS_PackageNo."No.", CS_PackageNo."No.");                    

                       Report.RunModal(Report::"TRU Sales Order Packing List-T", true, true, CS_PackageNo);

                   end;

               }

           }

    }

  • Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi antiqua,

    Can you please try below code?

    pageextension 70138 PackLineScanningPageExt extends "LAX Pack Line Scanning RTC"

    {

      layout

      {

      }

      actions

      {

          addafter(Printing)

          {

              action(CS_PackingList)

              {

                  ApplicationArea = All;

                  Caption = 'Print Packing List';

                  ToolTip = 'Print Packing List';

                  Image = PrintChecklistReport;

                  trigger OnAction()

                  var

                      CS_PackageNo: Record "LAX Package";

                  begin

                      CurrPage.SetSelectionFilter(rec);

                      CS_PackageNo.copy(rec);

                      //CurrPage.GetRecord(CS_PackageNo);

                   //    CS_PackageNo.SetRange(CS_PackageNo."No.", CS_PackageNo."No.");                    

                      Report.RunModal(Report::"TRU Sales Order Packing List-T", true, true, CS_PackageNo);

                  end;

              }

          }

    }

  • antiqua Profile Picture
    15 on at

    Thank you for your reply. But it is no luck. it looks like rec is not allowed there is no source table.

    pastedimage1654156072685v1.png

  • antiqua Profile Picture
    15 on at

    For a reference, the parent page is like this.

    page 14050138 "LAX Pack Line Scanning RTC"

    {

       Caption = 'Pack Line Scanning';

       PageType = Card;

       PromotedActionCategories = 'New,Process,Report,Info';

       layout

       {

           area(content)

           {

               group(Scanning)

               {

                   Caption = 'Scanning';

                   field("Package.""No."""; Package."No.")

                   {

                       ApplicationArea = All;

                       Caption = 'Package No.';

                       Editable = false;

                   }

               }

           }

       }

    }

  • Verified answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Ok, in that case your can try to create Global Procedure in the Page with parameter and call that function in the Action button.

    See if it works for you.

  • antiqua Profile Picture
    15 on at

    Dear Verma,

    Thank you for your reply.

    Unfortunately, the parent page belongs to a third party module, so it is read only.

    In that case, any detours?

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,028 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,366 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,175 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans