Codeunit 359 is used to control wich columns are presented, and this is the one You might want to modify.
If You want never to be able to present Saturdays or Sundays (wich is a bit too much, if You ask me) it can easily be obtained by adding these 2 lines of code:
IF PeriodType = PeriodType::Day THEN
Calendar.SETRANGE("Period No.",1,5);
just after SETRANGE has been done to "Period Type", in both "FindDate"- and "NextDate"-functions in the codeunit.
I will urge You to come up wth a more neat solution, perhaps by implementing one more value (say 'Day(5)') to the option-string in the PeriodType-parameter in the functions.
Or if this request is only needed on new forms, create "dublicate" functions in codeunit 359, where You add the extra option-value, and then call these functions from Your form instead. This will make future upgrades easier.
Regards
Alexander Pallesen
Freelance Developer - Navision
Comments
DATE2DWY(YourDate, 2);
It returns an integer (1 = Monday, 2 = Tuesday...6 = Saturday, 7 = Sunday). You can read more about it in the Navision help.
From there you can have logic that decided whether or not to skip the date.
My Blog - nav.education
This can be done using filters.
Codeunit 359 is used to control wich columns are presented, and this is the one You might want to modify.
If You want never to be able to present Saturdays or Sundays (wich is a bit too much, if You ask me) it can easily be obtained by adding these 2 lines of code:
just after SETRANGE has been done to "Period Type", in both "FindDate"- and "NextDate"-functions in the codeunit.
I will urge You to come up wth a more neat solution, perhaps by implementing one more value (say 'Day(5)') to the option-string in the PeriodType-parameter in the functions.
Or if this request is only needed on new forms, create "dublicate" functions in codeunit 359, where You add the extra option-value, and then call these functions from Your form instead. This will make future upgrades easier.
Regards
Alexander Pallesen
Freelance Developer - Navision
Alexander Pallesen
Freelance Navision Developer