Skip to main content

Notifications

Announcements

No record found.

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

Timesheet Total Quantity values

Posted on by 22

So I have been tasked with creating all the time sheets for business central; I've been adding in little features such as vacation balance, sick balance, TIL etc.
I implemented a fact box on the timesheet itself, but when entering values into a timesheet, my Rec."Total Quantity" remains at 0 in my code behind as I debug through the code. If I open the page inspector and look at my field values, it displays the correct value for the calculation for each line. I have no idea why I can't see this value in my code behind, and I would appreciate any help.
Has anyone else had this problem before? I'm very confused as to why It wont let me use the values of Total Quantity.

7652.pastedimage1681422794750v2.png

4382.pastedimage1681422894548v3.png

  • bcaron1000 Profile Picture
    bcaron1000 22 on at
    RE: Timesheet Total Quantity values

    ZHU!

    Thank you so much! Im a huge fan by the way, Ive been following your content since I started working within business central development!

    I did manage to get it to work. now Im wondering if i can programatically change the process button to be greyed out if a value reaches a negative value. I will research a bit more before i ask for any further instruction on that though.

    Thank you for your help!

    Bryan

  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 73,647 Super User 2024 Season 2 on at
    RE: Timesheet Total Quantity values

    Hi, This is a Flowfield, not a real value in the table, it will be calculated automatically when the page is opened.

    If you want to read this value in the code, you need to execute the following two methods first.

    Record.CalcFields(Any [, Any,...]) Method
    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/record/record-calcfields-method

    Record.SetAutoCalcFields([Any,...]) Method
    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/record/record-setautocalcfields-method

    pastedimage1681428881491v1.png

    More details: https://yzhums.com/5802/

    Hope this helps.

    Thanks.

    ZHU

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,269 Super User 2024 Season 2 on at
    RE: Timesheet Total Quantity values

    Moved the question from the Dynamics 365 Finance to the Dynamics 365 Business Central forum.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans