Hello.
Im new to Navi and i have a question:
How do i calculate date så every time i add a number it will print the same line X times with different date
I will use it when an employee is sick for 5 days, i should be able to print out new line for each day employee is sick.
example:
StartDate: 01/01/2016
I want to add 5 days to start date (a column), and it should print out a line from start date to 5 days forward.
Message('Date: %1', StartDate);
So every time it loop through it will add 1 day to the current startdate
so it will print out like this:
Output:
Date: 01012016
Date: 02012016
Date: 03012016
Date: 04012016
Date: 05012016
0
Answers
...where i is an Integer variable
To calculate a date from a reference date: https://msdn.microsoft.com/en-us/library/dd301368.aspx
Here is more information about dates and times in C/AL: https://msdn.microsoft.com/en-us/library/dd338710.aspx
By the way, there are version specific details about some of those, and you can select the version that you need at the top of most of the MSDN pages.
The top level MSDN link for the C/SIDE Reference Guide: https://msdn.microsoft.com/en-us/library/dd301468(v=nav.90).aspx
General link for development in NAV: https://msdn.microsoft.com/en-us/library/dd338764(v=nav.90).aspx
I think that should be a good start.
RIS Plus, LLC
RecordVar.RESET;
RecordVar.SETRANGE(some filter you need);
....
IF Recordvar.FINDLAST THEN
DateVar :=RecordVar.Date + 1D
ELSE
DateVar := Your start date.
I guess...