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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)
Suggested Answer

How to calculate the sum of 2 fields in my sales order?

(0) ShareShare
ReportReport
Posted on by 450

So i've created a field in my sales order of type decimal.

I want to have the sum of that field and the "Qty. to ship" field on that row. Now i looked into calcsums but i can't seem to figure out on how to use this.

After I want to check if the value is greater than the "Quantity" field.

Is there a way to accomplish this in AL code?

EDIT:

I found out that the fields are flowfields so that i need to calculate the value of a flowfield using Rec.CalcFields(Amount, "Qty. to ship") for example. Now the only problem i have now when i perform this action on this field it gives me an error that the amound field in the sales line must be a flowfield...

Any help is welcome

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,306 Super User 2026 Season 1 on at

    You can only do calcfield if your field is a flowfield. Amount and Qty. to ship are not flow field. Just normal field.

    You can do CALCSUM only if the field is specified as SumIndexFields in the table (Sales Line) table. Amount should be listed as SumIndexFields, but I don't think "Qty. to ship" is listed.

    Check this for reference.

    docs.microsoft.com/.../calcsums-function--record-

    Or just do the old fashion way. Do a loop and sum it manually.

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans