I had not batch posted shipments before, so never really noticed it.
The code was sort of correct in 3.10, but in 3.60 they added the Counter incorrectly, the error remains in 5.00. So is it possible that such an obvious bug as this has been there for this many years, or am I just blind.
The original code from 3.10 (the last working version) was this
Its obvious that someone started to add the counter but then messed it all up. By the way the error is about 4 times in the same code unit in similar areas. And yes, once they removed the IF, they no longer needed the COMMIT, but then of course the whole function is meaning less.
IF A then do xyz but if Not A well just do xyz anyway.
Sorry not a developer [;)] Any chance of a “translation” so I can throw my tuppence in!
Nuno - shipments are generally controlled individually, but invoicing is generally batch posted. The issue with just “shipping” everything is there is no control. If you have warehouse implemented you cannot batch ship anyway, but there are very few occassions where you would simply batch ship everything. That said I have two sites that do it based on the filters, but one the “shipment” is not the movement of goods, it is to create the posted shipment to track against and the invoice goes with the goods, the other batch ship sales orders based upon filtered drop shipment dates. However neither are using full warehousing (or even picks and putaways in these examples).
It really depends on the requirement at hand and what’s the best and most efficient way to resolve the client’s processing.
With that being said, I do have an installation site that does batch posting of shipping and invoicing and I’ve never noticed any problems with the counters at all. They’re on 3.7b. [^o)]
Its hard to see the difference because both options are the same code [:|]. The worst thing is that the same fundamental mistake appears three times in the same CodeUnit. its as if someone started copying the code, then went to lunch, then forgot to modify the second bit to do something different.
Basically the developer has a CASE statement that says
IF condition A then
do XYZ, or
IF condition B then
also do XYZ.
So in other words, completely ignore the condition. In fact these two pieces of code:
AND
Are exactly the same.
This only affects warehouse shipping, not normal Navision Inventory shipping. The issue is not with Counters, the problem is that if say you have a batch of 1,000 orders, and say the second one has a blocked item, then the process stops, and you would just have to keep filtering out all the orders that did not ship until it is all posted.
I am thinking that this probably happened just at the time of the Microsoft Takeover, so maybe the developers had other things on their mind at the time. [;)]