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

Notifications

Announcements

No record found.

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,698 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,698 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,698 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans