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

Summing up a total per GL account

(0) ShareShare
ReportReport
Posted on by

Hi All,

I need to add a field on Purchase Invoice Line such when I select a GL type option followed by G/L account on the line, the additional field should be populated by the sum / balance of the GL account.

Am using the code below in my new field

FieldClass = FlowField;
AutoFormatType = 1;
CalcFormula = Sum ("G/L Entry".Amount WHERE("G/L Account No." = FIELD("No.")));
// "G/L Account No." = FIELD(FILTER(Totaling)),
//"Business Unit Code" = FIELD("Business Unit Filter"),
//"Global Dimension 1 Code" = FIELD("Global Dimension 1 Filter"),
//"Global Dimension 2 Code" = FIELD("Global Dimension 2 Filter"),
//"Dimension Set ID" = FIELD("Dimension Set ID Filter")));

but am getting errors on the commented lines, is there something wrong or is there a better way to get the balance of the selected GL entry?.

  • Romryan Profile Picture
    on at

    any suggestions?.

  • Suggested answer
    THE Italian Profile Picture
    Microsoft Employee on at

    You have not specified 

    a. Version and build that you are using

    b. Localized version (e.g. W1, CH, etc.)

    c. If you are developing in AL or C/AL

    d. A screenshot of the error(s)

    Quite hard to answer this objectively, frankly speaking.

    If you could provide all of these, this blog post might be answered by a more broad adience.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 753 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 583 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 302 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans