Hi,
In my own code I need to do backward scheduling and forward scheduling considering non-working days based on the DateFormula-Field Item."Lead Time Calculation"
Is there a simple standard function I can use for this.
Thanks in Advance
Ralf
Hi, have you investigated codeunit 7600 "Calendar Management"?
For example,
Hope this can give you some hints.
Thanks.
ZHU
The base calendar is assigned and I have indicated what are working days and what are not working day.
But I have trouble recognizing and using the help function in the CU 7600. My code below works correctly but is very inefficient, so I would like to use this helper function. Could I get an example of forward and backward scheduling?
procedure fnCalculateDateBackward(parDueDate: Date; parDateformula: DateFormula) StartDateL: Date var NumerOfDaysL: Integer; I: Integer; begin StartDateL := parDueDate; NumerOfDaysL := (CalcDate(parDateformula, 20010101D) - 20010101D); for I := 1 to NumerOfDaysL do begin StartDateL := CalcDate('<-1D>', StartDateL); if CalenderMgmtG.IsNonworkingDay(StartDateL, CustomizedCalenderChange) then begin I := I - 1; end; end; end;
You should start by setting up a base calendar were you indicate what is working days and what are not working days.
Then you take that calendar into considerations when you do your calculation.
learn.microsoft.com/.../across-how-to-assign-base-calendars
Then you have codeunit 7600 "Calendar Management" that have some helper function that can help you find the next working day etc.
hi
look this
robertostefanettinavblog.com/.../
learn.microsoft.com/.../dateformula-data-type
DAniele
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,101 Super User 2024 Season 2
Martin Dráb 229,908 Most Valuable Professional
nmaenpaa 101,156