Getting "Invalid Date" on Item.Get() or Item.FindFirst

MJV
Member Posts: 38
This issue was resolved.
I missed one of the date fields when I did my tests on the Item record.
It did indeed have some kind of corrupted date.
updating that date with SQL resolved the issue.
Thanks,
Michael
Hi,
In Business Central 14 (we are using the C/AL version with windows client),
Today we started to get the error
"Invalid Date"
anywhere in the system that an Item.Get() or item.Findfirst is called on certain item numbers.
For example, this code emits the error.
lrecItem.INIT;
lrecItem.SETFILTER("No.", '601874');
IF lrecItem.FINDFIRST THEN BEGIN
; //don't care...
END;
checking the dates on all items in the item table using Transact SQL, the actual date fields in our item table seem to have valid dates:
select * from (
select item.timestamp
, isdate(item.[Last Unit Cost Calc_ Date]) date1
, isdate(item.[Need Date]) date2
, isdate(item.[Next Counting End Date]) date3
, isdate(item.[Next Counting Start Date]) date4
, isdate(item.[Order Display Date]) date5
, isdate(item.[Production Date]) date6
, isdate(item.[Publication Date]) date7
, isdate(item.[Scheduled Date]) date8
, isdate(item.[Web Display Date Begin]) date9
, isdate(item.[Web Display Date End]) date10
--, item.*
from [OurCompanyName$Item] item
where 1 = 1
) AllRecs
where 1 = 1
and (
(date1 <> 1)
or
(date2 <> 1)
or
(date3 <> 1)
or
(date4 <> 1)
or
(date5 <> 1)
or
(date6 <> 1)
or
(date7 <> 1)
or
(date8 <> 1)
or
(date9 <> 1)
or
(date10 <> 1)
)
I am wondering if some system date is off that the base code is encountering behind the scenes while executing.
Has anyone else encountered this error?
I am going to try compiling all of the objects and see if that helps.
Thanks,
Michael
I missed one of the date fields when I did my tests on the Item record.
It did indeed have some kind of corrupted date.
updating that date with SQL resolved the issue.
Thanks,
Michael
Hi,
In Business Central 14 (we are using the C/AL version with windows client),
Today we started to get the error
"Invalid Date"
anywhere in the system that an Item.Get() or item.Findfirst is called on certain item numbers.
For example, this code emits the error.
lrecItem.INIT;
lrecItem.SETFILTER("No.", '601874');
IF lrecItem.FINDFIRST THEN BEGIN
; //don't care...
END;
checking the dates on all items in the item table using Transact SQL, the actual date fields in our item table seem to have valid dates:
select * from (
select item.timestamp
, isdate(item.[Last Unit Cost Calc_ Date]) date1
, isdate(item.[Need Date]) date2
, isdate(item.[Next Counting End Date]) date3
, isdate(item.[Next Counting Start Date]) date4
, isdate(item.[Order Display Date]) date5
, isdate(item.[Production Date]) date6
, isdate(item.[Publication Date]) date7
, isdate(item.[Scheduled Date]) date8
, isdate(item.[Web Display Date Begin]) date9
, isdate(item.[Web Display Date End]) date10
--, item.*
from [OurCompanyName$Item] item
where 1 = 1
) AllRecs
where 1 = 1
and (
(date1 <> 1)
or
(date2 <> 1)
or
(date3 <> 1)
or
(date4 <> 1)
or
(date5 <> 1)
or
(date6 <> 1)
or
(date7 <> 1)
or
(date8 <> 1)
or
(date9 <> 1)
or
(date10 <> 1)
)
I am wondering if some system date is off that the base code is encountering behind the scenes while executing.
Has anyone else encountered this error?
I am going to try compiling all of the objects and see if that helps.
Thanks,
Michael
0
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