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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Multiple List Parts on Card Page

(5) ShareShare
ReportReport
Posted on by 481
Hi all, 
 
We have a scenario where we needed to show 3 List Parts in one page - showing related data. Mockup below; 
 
 
We managed to get the list parts to work together i.e. when a student is selected in List Part A, the related records are shown in the other 2 list parts i.e. List Part B shows the courses of the selected student and List Part C shows the attendance of the selected student. 
 
The problem we are facing is when a user click on the New button within the List Part B and the related Course Card page is opened, then the context of which student is selected in List Part A is not carried over when creating a new Course Record. 
 
How is the best way to handle this? 
I have the same question (0)
  • Suggested answer
    Yash_Mistry Profile Picture
    512 on at

    You can either define the primary key of List Part B based on the context so that it is automatically populated with the current subpage link, since only primary key fields are populated via the link. However, this is not an optimal approach.

     

    You can refer to the Project Module New Action in the subpage, as it references the same Job No. primary key as in the card page.

     



    If you still need to pass more than one reference from List Part A, include the Reference Line No. as part of the primary key in Part B. This way, when a new record is inserted, you can retrieve that line in the OnNewRecord() or OnInsertRecord() trigger.

    Regards,
    Yash Mistry
  • Suggested answer
    RockwithNav Profile Picture
    9,142 Super User 2026 Season 1 on at
    Did you trying putting code on the OnNewTrigger()?
    I know that wont be straight but without changing the schema of any tables I will will say play with these triggers and it will help you achieve what you are willing.
  • Suggested answer
    OussamaSabbouh Profile Picture
    16,699 Super User 2026 Season 1 on at
    Hello,
    Best practice is: don’t rely on the standard New action of the ListPart if you need parent context from another part. SubPageLink is great for filtering/displaying related records when selection changes, but it doesn’t automatically guarantee that your selected Student from List Part A is carried into a new card opened from List Part B. The usual clean solution is to replace/override New with your own action on the courses part (or host page), pass the selected student explicitly, initialize the new course record, and then open the card/page with that record. In practice, set "Student No." (or your parent key) before opening the card, or do it in OnNewRecord after passing the value through a setter on the page. So: use SubPageLink for showing related lines, but use a custom New action to create child records with the current parent/student context.
    Regards,
    Oussama Sabbouh
  • Gerardo Rentería García Profile Picture
    26,844 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

     

    Best Regards
    Gerardo

  • Suggested answer
    Aman Kakkar Profile Picture
    3,532 Super User 2026 Season 1 on at
    Hi,
     
    In these kind of scenarios, what I generally do is use Single Instance Codeunits.
     
    What it does is, it stores your variables data throughout the session. In your case, you can create a codeunit with SetStudentID and GetStudentID, and enable the SingleInstance property -
     
    STEP 01: Create a Single Instance Codeunit -
    codeunit 95006 SingleInstanceCU
    {
        SingleInstance = true;
    
        procedure SetStudentID(RecStudentID: Code[20])
        begin
            StudentID := RecStudentID;
        end;
    
        procedure GetStudentID(): Code[20]
        begin
            exit(StudentID);
        end;
    
        var
            StudentID: Code[20];
    }
    STEP 02: On the OnAfterGetCurrRecord trigger of ListPart A, call the SetStudentID function and pass the value of Student ID.
     
        trigger OnAfterGetCurrRecord()
        begin
            SingleInstanceCodeunit.SetStudentID(Rec."No.");
        end;
    
        var
            SingleInstanceCodeunit: Codeunit SingleInstanceCU;
     
    STEP 03: In the ListPart B and ListPart C, on the OnNewRecord() trigger in the ListPart Page, call the GetStudentID() to get the ID of the currently opened Student.
     
        trigger OnNewRecord(BelowxRec: Boolean)
        begin
            Rec."No." := SingleInstanceCodeunit.GetBidNo();
        end;
    
        var
            SingleInstanceCodeunit: Codeunit SingleInstance;
     
    Simple and easy.
     
    If you find it helpful, do mark it as verified.
    Aman K
  • Suggested answer
    YUN ZHU Profile Picture
    101,416 Super User 2026 Season 1 on at
    Hi, hope the following helps as well.
     
    Thanks.
    ZHU

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April 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,216 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,471 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,369

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans