Datefield on request form

Nabuco
Member Posts: 65
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
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
-
So you created a new variable type DATE.
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?0 -
Hi thanks for taking time to view this.
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.0 -
Nabuco wrote:I will make a check to ensure that the date cannot be later than the RemDate
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?0 -
You say a user should be able to enter another 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.0 -
Thanks both to Vaprog and Savatage for taking time to look at this.
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');0 -
Vaprog: Thanks for the "eyeopener". Unintentionally the property was set to YES - it Works fine now0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions