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.
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
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
More details: https://yzhums.com/5802/
Hope this helps.
Thanks.
ZHU
Moved the question from the Dynamics 365 Finance to the Dynamics 365 Business Central forum.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156