When the function "Create Whse. Shipment" is called from a Sales Order, the Warehouse Shipment Header is created, but the lines are empty.
The location has "Require Shipment" = TRUE.
But the strange thing is that if I start the CodeCoverage to see where the application stopps executing the code, the Whse. Shipment lines are perfectly created. When i close the CodeCoverage and call the function again the lines are empty again.
Navision 4.01 Objects are used on a SQL DB.
Does anybody have an idea what's the reason of that strange behaviour?
0
Comments
Also are you sure the lines are created only when you have codecoverage on?
Put a break point where it insert the record. and see if debugger stops in there. Also if you have multiple lines on SO then it would go through the CU twice.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
When you finish the function, go to the table. Design it, close it without saving and check if the records have been created.
BTW: which SQL server do you use?
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
The Outstanding Quantity is > 0 (otherwise the lines would not have been created when I turned of the CodeCoverage).
Unfortunately, that error happens rather unpredictable. On some PCs the error never appears, on others it does very often. Sometimes it's enough to reopen the database or change the licence and the error does not come - for the moment. An hour later on the same PC it appears again.
In debug mode or running CodeCoverage I never had the opportunity to see what happens when the error happens.
I suppose that a transaction can not be finished or something like that and the database performes a rollback. The Whse. Shipment Header is not deleted by the rollback because after the header is created a COMMIT writes it back to the DB. What do you think of that?
(It's an SQL server 2005)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
say you have 3 in bin a and 3 in bin b. you create a transfer for 5, create the shipment and run the create pick. Sometimes, it will make a pick for 3 from bin a and 2 from bin a. When this happens, you can delete the pick, re-create it and run it again, and it will do the same thing, but if you try to debug or run code coverag, it picks 3 from bin a and 2 from bin b. ](*,)
This is on 3.70 with C/SIDE DB. All I cn think of is that in FindBin, it is not updating the SIF in time for the next read. (I have seen that in SQL, but not in Native before) (or is it classic now?)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Try running report 5753 (VL NAVW14.00.01)
Source No. = <Sales Order No.>
Type = Outbound
Source Type = 37
Document Status = Release
(The sales header will have had to have been released
See if that throws an error for you.
I've had a quick look at the code (E&OE) It seems to check the Whse. Outstanding Qty. (Base) on the sales line.
If its less than the "Outstanding Qty. (Base)" (on the sales line) then it should go and create the Whse Shpt Line.
The first time it finds one within this criteria it creates the Header.
So it there has to be a valid line before it will consider creating the header.
From the code I read if it errors you should get the error on screen, there is no
But I just browsed the code.
The path it follows is :-
Report 5753 - Sales Line Dataitem
->Codeunit 5750 Fucntion(CheckIfFromSalesLine2ShptLine)
->Codeunit 5750 Function(FromSalesLine2ShptLine)
-->Codeunit 5750 Function(UpdateShptLine)
-->Codeunit 5750 Function(CreateShptLine)
Look at the above like it was a report indented dataitem
Thats actually all there is too it. i was amazed myself.
Hope that helps, if you get stuck, or are still getting problems let us all know
T