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

How to retrieve data using flowfield from different pages which is same table?

(9) ShareShare
ReportReport
Posted on by 259
Hi All,
 
I want to get Document Type and Document No. using flowfield of the highlighted invoice > Applied Entries > Applied Customer Entries so how can I get that data?
 
And how can I find relation that I want data from Applied Customer Entries from that particular invoice only?
 
Customer Ledger Entry and Applied Customer Entry are using same table.
 
 
 
I have the same question (0)
  • Suggested answer
    Kamal Khakhkhar Profile Picture
    2,998 on at
    Hii There,
    as per requirement you can create a flow field using method LookUp() with some of filter but if There is Multiple type of document , you can get wrong data . so check that.
     
    If You found answer, Mark It answered.
     
    Thank You.
    Kamal Khakhkhar
  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,817 Super User 2026 Season 1 on at
    Hello,
     
    To retrieve the Document Type and Document No. from Applied Customer Entries related to a specific invoice, you can filter the Cust. Ledger Entry table using the Applies-to ID of the invoice entry.
     
    Since both the invoice and its applied entries reside in the same table, this filter helps identify only those entries that were applied to the invoice, allowing you to access their document details through a FlowField or custom logic.
  • Suggested answer
    Jeffrey Bulanadi Profile Picture
    9,112 Super User 2026 Season 1 on at

    Hi,

    If you want to retrieve Document Type and Document No. from a record within Applied Customer Entries, filtered so that only entries applied to a specific invoice appear. Since both Customer Ledger Entry and Applied Customer Entry derive from the same table (Cust. Ledger Entry), the key lies in using a FlowField with filtered relations.

    Let’s break it down:

     

    1. How FlowField works with same-table relationships
    In BC, a FlowField can reference the same table if filtered correctly. For Applied Entries:

    • Each Cust. Ledger Entry has related application entries (based on Applies-to ID and Applies-to Doc. No.)
    • You can filter the FlowField using the current record’s Entry No. or Document No. to retrieve its corresponding applications

    Example FlowField setup:

    al
    field(50000; "Applied Document No"; Text[20])
    {
        CalcFormula = Lookup("Cust. Ledger Entry"."Document No." WHERE("Applies-to ID"=FIELD("Applies-to ID")));
        FieldClass = FlowField;
    }
     

    You can further restrict this with:

    al
    CalcFormula = Lookup("Cust. Ledger Entry"."Document No." 
        WHERE("Applies-to ID"=FIELD("Applies-to ID"),
              "Document Type"=CONST(Invoice)));
     
     

    2. How to find which entry relates to the selected invoice
    Given a selected invoice (like SI272436 highlighted in your image), you can retrieve applied entries by:

    • Filtering Cust. Ledger Entry where "Applies-to Doc. No." = 'SI272436'
    • Or where "Applies-to ID" equals the Document Entry ID of the invoice

    Use this in your page extension or custom page to show only applied entries tied to that invoice.

     

    3. Optional: Use SetAutoCalcFields in AL
    If you're building a list page and want applied document numbers to show instantly:

    al
    CustLedgerEntry.SetAutoCalcFields("Applied Document No");
     

    This lets the system auto-calculate the FlowField as you browse the list.

     

    Helpful references:

    Design FlowFields in AL – Microsoft Learn
    How Applications Work in BC – Steve Endow
    Same Table FlowField Examples – Mibuso


    If you find this helpful, feel free to mark this as the suggested or verified answer.

    Cheers
    Jeffrey

  • Suggested answer
    YUN ZHU Profile Picture
    99,507 Super User 2026 Season 1 on at
    You could simply relate them using the field below, but this is a one-to-many relationship so this is not accurate.
    You can refer to the standard logic when this page is opened.
     
    Hope this helps.
    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 March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,933 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,055 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 640 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans