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

Get Record of Current Page from within SubPage

(0) ShareShare
ReportReport
Posted on by 15

Hi all!

I have two tables, a "Project" table and a "Projectline" table. I have a card page for the Project, and within that card page I have a Page (Type=ListPart) for my ProjectLines. I would like to include the primary key of the Project table in my ProjectLine table, however I don't know how to copy that value because I am not technically within the Project table while I'm inserting new records into the ProjectLines Subpage.

Can anyone help me get the value of the Project Table, and insert it into the projectlines record table?

Side note: If anyone has tutorials on finding/sorting/filtering records, I would love to see them.. I cannot quite make sense of Microsoft's built-in documentation..

Thanks!

I have the same question (0)
  • Suggested answer
    Govinda Kumar Profile Picture
    2,304 Moderator on at
    RE: Get Record of Current Page from within SubPage

    Hi Garrett B,

    To include the primary key of your Project table in the ProjectLine subpage you need to add the table relation and then subpage link it to your cardpage.

    In your Project Line table

            field(1; ProjectNo; code[20])
            {
                TableRelation = ProjectTable.ProjectNo;
            }
            field(2; LineNo; Integer)
            {
                AutoIncrement = true;
            }
        }
    
        keys
        {
            key(PK; ProjectNo, LineNo)
            {
                Clustered = true;
            }
        }

    In your project card page

                    part(ProjectLineSubPage; ProjectLineSubPage)
                    {
                        ApplicationArea = All;
                        SubPageLink = ProjectNo = field(ProjectNo);
                        Caption = 'Project Lines';
                    }

    Make sure that ProjectNo is the primary key value in your Project Table as well.
    Let me know if you have any further questions

    Regards

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

#2
Sumit Singh Profile Picture

Sumit Singh 2,123

#3
YUN ZHU Profile Picture

YUN ZHU 1,813 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans