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

Community site session details

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

Can't reference custom page

(0) ShareShare
ReportReport
Posted on by 22

Hi All,

Just a quick question, I created a new page and would like to reference this page for a trigger that i created on a pageextension (for an existing page)

however, when i try this , I'm getting 'Page' does not contain a definition for 'Page name' AL1032

Is this possible? If not is there any way that I can get around this without reinventing the wheel?

Thanks
Rajiv

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: Can't reference custom page

    Hi rajivsewsarran ,

    Not sure if I am understanding it correctly, you can always declared that page's variable in your trigger, is this the issue? or you can more elaborate your issue.

    Thanks.

  • rajivsewsarran Profile Picture
    22 on at
    RE: Can't reference custom page

    Hi Nitin,

    I created a new table and a new page. I would like to reference this new page in a trigger for a page extension that i created for the Payment Journal Page.

    When i try the trigger it gives me the error mentioned above.

    is there some special way of doing this?

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: Can't reference custom page

    Please share your code here.

  • rajivsewsarran Profile Picture
    22 on at
    RE: Can't reference custom page

    table 50100 Payments
    {
        DataClassification = ToBeClassified;
    
        fields
        {
            field(1; "Posting Date"; Date)
            {
                DataClassification = ToBeClassified;
                TableRelation = "Gen. Journal Line"."Posting Date";
                Caption = 'Posting Date;';
    
    
            }
            field(2; "Batch Name,"; Code[20])
            {
                DataClassification = ToBeClassified;
                TableRelation = "Gen. Journal Line"."Journal Batch Name";
                Caption = 'Batch Name';
            }
            field(3; "Vendor ID"; Text[200])
            {
                DataClassification = ToBeClassified;
                TableRelation = "Gen. Journal Line"."vendor ID";
                Caption = 'Vendor ID';
    
            }
            field(4; "Vendor Name"; Text[200])
            {
                DataClassification = ToBeClassified;
                TableRelation = "Gen. Journal Line".Description;
                Caption = 'Vendor Name';
            }
            field(5; Amount; Decimal)
            {
                DataClassification = ToBeClassified;
                TableRelation = "Gen. Journal Line"."Amount (LCY)";
                Caption = 'Amount';
            }
            field(6; "Entity Code"; Code[20])
            {
                DataClassification = ToBeClassified;
                TableRelation = "Gen. Journal Line"."Shortcut Dimension 1 Code";
                Caption = 'Entity Code';
            }
            field(7; "Account Number"; text[100])
            {
                DataClassification = ToBeClassified;
                TableRelation = "Gen. Journal Line"."Bal. Account No.";
                Caption = 'Account Number';
            }
    
        }
    
    
    
    page 50101 Payments
    {
        PageType = List;
        ApplicationArea = All;
        UsageCategory = Administration;
        SourceTable = "Gen. Journal Line";
    
        layout
        {
            area(content)
            {
                repeater(General)
                {
                    field("Batch Name "; Rec."Journal Batch Name")
                    {
                        ToolTip = 'Specifies the Batch the Payment is assigned to.';
                        ApplicationArea = All;
                    }
                    field("Posting Date"; Rec."Posting Date")
                    {
                        ToolTip = 'Specifies the date the payment was/will be posted.';
                        ApplicationArea = All;
                    }
                    field("Vendor ID"; Rec."Vendor Id")
                    {
                        ToolTip = 'Specifies the Vendor ID to whcih the payment was applied.';
                        ApplicationArea = All;
                        VIsible = false;
                    }
    
                    field("Vendor Name"; Rec.Description)
                    {
                        ToolTip = 'Specifies the name of the Vendor to which the payment was applied.';
                        ApplicationArea = All;
                    }
    
                    field("Amount"; Rec.Amount)
                    {
                        ToolTip = 'Specifies the Amount that was paid.';
                        ApplicationArea = All;
                    }
    
                    field("Entity Code"; Rec."Shortcut Dimension 1 Code")
                    {
                        ToolTip = 'Specifies the Entity.';
                        ApplicationArea = All;
                    }
    
    
                    field("Account No."; Rec."Bal. Account No.")
                    {
                        ToolTip = 'Specifies the Account Number.';
                        ApplicationArea = All;
                    }
    

    The above is the Table and Page that I created

    Below is the trigger that i'm trying to use to drill down into the newly created page

    field("Escrow Payments"; Rec."Escrow Payments ")
                {
                    ApplicationArea = all;
                    Caption = 'Escrow Payments';
                    DrillDown = true;
                    trigger OnDrillDown()
                    var
                        selpmt: Record "Bank Account";
                    
    
                    begin
                        selpmt.SetRange("Escrow Payments");
                        selpmt.get(Rec."No.");
                        Page.RunModal(Page::"Payment Journal");
    
                    end;
    

    The drill down works fine if i go to the payment journal, but i need it to go to the newly created page. When i replace "Payments Journal" with "Payment" i get the error mentioned in the first post.

    If this cant work is there a way i can filter the Escrow Payments - so when i drill down into that, i can see the payments that are assigned to that particular bank account, rather that at a batch level?

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: Can't reference custom page

    Hi,

    Please try below property in your Table

    table 50100 Payments
    {
        DataClassification = ToBeClassified;
        LookupPageId = Payments;
        DrillDownPageId = Payments;
  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: Can't reference custom page

    Also please change your Sourtable with your custom table here.

    page 50101 Payments

    {

       PageType = List;

       ApplicationArea = All;

       UsageCategory = Administration;

       SourceTable = "Gen. Journal Line";

  • rajivsewsarran Profile Picture
    22 on at
    RE: Can't reference custom page

    HI Nitin,

    When i do this, the information that i need duplicated from the Payments Journal screen doesn't come across.

    Maybe im think about this incorrectly.

    if we forget everything that was mentioned above. What i initially was trying to do was this;

    I created a column on the Bank Account list called "escrow Payments" this is the total of the payments assigned to each Bal. Account Number on the Payment Journal Screen.

    I made the "Escrow Payments" a drill down. However when i drill down, it show the payments that are assigned to a batch, rather than filtering all the payment assigned to the Bal Account number.

    Does this sound doable?

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: Can't reference custom page

    show your that code, how you are drilling down now.

  • rajivsewsarran Profile Picture
    22 on at
    RE: Can't reference custom page

    field("Escrow Payments"; Rec."Escrow Payments")

               {

                   ApplicationArea = all;

                   Caption = 'Escrow Payments';

                   DrillDown = true;

                   trigger OnDrillDown()

                   var

                       Escpmts: Record "Bank Account";              

                   begin

                       Escpmts.SetRange("Escrow Payments");

                       Escpmts.get(Rec."No.");

                       Page.RunModal(Page::"Payment Journal");

                   end;

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: Can't reference custom page

    Hi Please try to change as per below

                 var                              

                      varPayments: Record Payments;

                  begin

                     varPayments.setrange("Account Numnber","No.");

                      Page.RunModal(Page::"Payments",varPayments);

                  end;

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,351

#2
Sumit Singh Profile Picture

Sumit Singh 2,072

#3
YUN ZHU Profile Picture

YUN ZHU 1,807 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans