Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 28, 2025

Adds FlowFields to Customer and Vendor tables that calculate total due amounts filtered by date, displayed on respective Card pages.

Changes

Table Extensions (IDs 80550-80551)

  • CustomerExtension.TableExt.al - FlowField summing Detailed Cust. Ledg. Entry.Amount filtered by Customer No. and Initial Entry Due Date
  • VendorExtension.TableExt.al - FlowField summing Detailed Vendor Ledg. Entry.Amount filtered by Vendor No. and Initial Entry Due Date

Page Extensions (IDs 80550-80551)

  • CustomerCardExtension.PageExt.al - Adds Due Amount field after Balance (LCY)
  • VendorCardExtension.PageExt.al - Adds Due Amount field after Balance (LCY)

Implementation

field(80550; "Due Amount"; Decimal)
{
    FieldClass = FlowField;
    CalcFormula = Sum("Detailed Cust. Ledg. Entry".Amount 
        where("Customer No." = field("No."),
              "Initial Entry Due Date" = field("Date Filter")));
    Caption = 'Due Amount';
    Editable = false;
}

Date filtering enabled via field("Date Filter") reference - users can apply date ranges on the Card pages to dynamically recalculate due amounts. FlowFields calculate on-demand using indexed filters.

Original prompt

This section details on the original issue you should resolve

<issue_title>Enhance Customer and vendor due amount</issue_title>
<issue_description>We need to enhance the Customer and Vendor Card page in Business Central by adding a new FlowField that shows the Due Amount of the customer.
Requirements:

  1. Add a FlowField in the Customer/Vendor table extension that calculates the total due amount for the customer.
    ○ The field should reference the Detailed Cust. Ledg. Entry and Dtld. Vendor Ledger Entry
    ○ It must calculate the sum of Amount where Due Date is within the applied filter.
  2. Enable a Date Filter on this FlowField so users can select a date range to dynamically view the due amounts.
  3. Display the new field on the Customer/Vendor Card page so end users can easily access the information.
  4. Filter Fields are not displayed on pages
    Acceptance Criteria:
    • A new field "Due Amount" is available on the Customer/Vendor Card.
    • The field correctly reflects the customer’s/Vendor's total outstanding due amounts.
    • Users can apply a date filter, and the field recalculates accordingly.
    • No performance degradation occurs when opening the Customer/Vendor Card.
    Notes:
    • Follow AL coding best practices. https://alguidelines.dev/ https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/
    • Ensure compatibility with existing customer extensions.</issue_description>

<agent_instructions>Follow AL coding best practices.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: fmoric <18283753+fmoric@users.noreply.github.com>
Copilot AI changed the title [WIP] Add due amount FlowField to Customer and Vendor Card Add Due Amount FlowFields to Customer and Vendor Cards Oct 28, 2025
Copilot AI requested a review from fmoric October 28, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance Customer and vendor due amount

2 participants