Hi all
Being rather a novice in Navision coding i have a problem and can't se the solution myself:
In a report (2009 SP1) I have defined a Global var. with type Date. Have placed this in on the requestform with a calculated initial value - shows correctly.
When user alter this date I get the error-message: The date formular '011010' contains a number that is too large. The number must be in the range 0-9999.
Why numbers in a date-field?
Anyone know a solution to this?
Thanks in advance
0
Answers
With that you can enter any date into that field ...
...but the below messages shows something else is going on here.
The two things in your message I would look at are:
"with a calculated initial value.."
"The date formula....."
What is your code?
What formula are you using?
What are you trying to accomplish?
http://www.BiloBeauty.com
http://www.autismspeaks.org
The Global var. of type DATE I initiate with a datecalc.:
MaxDate := CALCDATE('<-7Y>',TODAY);
RemDate := Maxdate;
The Then user should be allowed to enter another date in MaxDate and I will make a check to ensure that the date cannot be later than the RemDate (IT is to be used when delete som very special journals which by law we are obligated to keep for at least 7 years.
If you activate the debugger while entering the date on the request form, what code causes the error (gets the focus in the debugger)?
Did you set any properties or triggers on the control for MaxDate?
But Maxdate isn't what the users are actually changing.
they are changing the value of "TODAY" in your maxdate calculation.
So you need to accomplish figuring that out.
Like they can either enter a date or it uses today as a default, or how ever you want it to be.
eith that or just make the remdate = entered date directly in some part of the code.
perhaps you're missing something you didn;t mention beacuse it soulds like it should work.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Sorry Vaprog, the debugger does not help here, the error turn up before debugger catch the error.
Savatage, it is on the "InitReport" trigger I initiate the MaxDate and REMdate.
I use Integer as run-tabel with MaxIteration=1 and then on the requestform the user has the opportunity to amend this MaxDate and then on the "OnAfterGetRecord" trigger I have the following:
IF MaxDate > RemDate THEN
ERROR('Txt001');
Please check the DateFormula property on the control for MaxDate on the request form.