Hey guys,
I need some help! The environment is NAV 5.0 + SQL 2005 SP2. I
got an error message when I tried to post the sales order. Navision
prompted me an Item Ledger Entry sql insert statement error from SQL
Server saying that the values dont match the column definitions.
Well, I need to tell you a little bit more about what I have done.
Eventually, I had an requirement that the customer need to see the item
inventory per locations in another system which synchronizes data from
Navision. So what I have done is to create a key "Item No." + "Location
Code"on Item Ledger Entry table and assign "Quantity" as
SumIndexQuantity, after that I found out the SumIndexTable on SQL
server which maintains the Item inventory per location and add this
sumindex table into a SQL replication(off course, there are lots of
others replicated tables, but those are fine).
Now everything is fine, the third part application can takes data
from replication and show the right inventory per location there. But
when I try to post sales order in navision it complains about the insert sql
statement for Item Ledger Entry does not match the column definitions
etc.... So what I did is to remove the sumindex table from the
replication. Then I tried to post the sales order again, everything was fine. And the strange thing is sometimes when I make the sum fields on the sumindex table allow nulll I can post the sales orders, but sometimes I get that error. If i dont replicate it everything is fine.
The problems is when I copy the error message and compare the
values with the columns one by one, that took me a whole lot of time, I
found there is no mismatch, even I repeated this process twice they are
matched. And from the beginning to the end I did not add new fields or
change the column types of item ledger entry table on SQL server and no replication for this table either.
I have also taken an indeep look at the Item Ledger Entry sql table,
there is a trigger called "Item Ledger Entry_TG", it contains the logic
for SQL to maintain all the item ledger entry sumindex tables. But I
really cant find what is wrong here.
Now I am running out of idea.
If you guys have any idea about this please do let me know,
APPRECIATED!
Best Regards,