I'm running into a bizarre situation where calling COUNT on a table is generating a very unexpected error. The error is as follows:
As you can see, this is the typical error that you would get when attempting to insert a duplicate key entry into a table. The error is raised from the following code line:
What makes this yet even stranger is that prior to this code (in my test case) I have called DELETEALL before inserting a single line. Obviously if all the records are deleted and one entry is then inserted, there should be no key collision. I have never in my life seen Navision generate a "line already exists" error from a call to the COUNT function. I'm assuming this must be a bug in the new RTC nav engine. Has anyone else seen this happen? Does anyone know what is going on here?
The Dynamic Move Line already exists. Identification fields and values: ...
As you can see, this is the typical error that you would get when attempting to insert a duplicate key entry into a table. The error is raised from the following code line:
IF DynamicMoveLine.COUNT > 1 THEN
What makes this yet even stranger is that prior to this code (in my test case) I have called DELETEALL before inserting a single line. Obviously if all the records are deleted and one entry is then inserted, there should be no key collision. I have never in my life seen Navision generate a "line already exists" error from a call to the COUNT function. I'm assuming this must be a bug in the new RTC nav engine. Has anyone else seen this happen? Does anyone know what is going on here?