Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Columns in a table is non-zero, but printing them in BC make them zero

(0) ShareShare
ReportReport
Posted on by 479

In the Sales Invoice Header table, there are these Amounts for a specific customer:
21.PNG

I have this code that will collect each of those remaining amounts.
1602.PNG
Upon running it the column values for "amount" show up as 0 when Messaging/Printing to BC.
24.PNG

But when printing out the Sales Invoice No. (referring to table picture above), it messages the number just fine:
5504.PNG it grabs the correct posted invoices

Is there something wrong with my logic here?
I am working on a report extension for the Customer Statement report.

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,595 Super User 2024 Season 2 on at
    RE: Columns in a table is non-zero, but printing them in BC make them zero

    Hi, These fields are FlowFields, which are not really data in the table. They will be recalculated when the page is opened.

    There are two ways when you want to use its value.

    Record.CalcFields: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/record/record-calcfields-method

    Record.SetAutoCalcFields: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/record/record-setautocalcfields-method

    More about FlowFields: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-flowfields

    Hope this helps as well.

    Thanks.

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,081 Super User 2024 Season 1 on at
    RE: Columns in a table is non-zero, but printing them in BC make them zero

    Hi jdrco ,

    Please use below code inside the repeat..until

    salesinvHeaderRec.Calcfields(Amount);

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans