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

MJVMJV Member Posts: 38
edited 2024-03-21 in NAV Three Tier
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
Sign In or Register to comment.