Hello,
I have a DATEFORMULA type value that establishes the number of working days and an initial date that establishes the date on which the count begins.
How can I get the amount placed in the DATEFORMULA field and use it to set only working days and from this formula to have a final date?
0
Answers
If the date formula is "1M", then I'd first calculate the number of days I need.
EndDate := CALCDATE('1M',TODAY);
NumberOfDays := EndDate - TODAY;
MESSAGE(FORMAT(NumberOfDays)); //31 days
Then I would use the suitable function in CalendarManagement to find the 31st business day at desired calendar code.
If in the field DATEFORMULA I have 50D, I need to count 50D only seeing Monday, Tuesday, Wednesday, Thursday and Friday. exclude weekends and non-working days.
Look into Calendar Management codeunit instead, there are functions in there which could help you achieve what you want. Examples of use are in T37/T39, CalcPlannedShptDate
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03