Warehouse Shipment Lines not created

XMLXML Member Posts: 10
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?

Comments

  • ara3nara3n Member Posts: 9,258
    That is strange. Remember warehouse shipment lines are created once. So you have to delete the whse. doc to recreate them. Also make sure the oustanding quantity is not zero.

    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.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • krikikriki Member, Moderator Posts: 9,118
    It might be a problem with buffering.
    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?
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • XMLXML Member Posts: 10
    Thanx for your replies!

    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)
  • ara3nara3n Member Posts: 9,258
    If you are using sql2005. And getting these strange bugs, I would install the sp3 client. Where is the commit?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • AnonymousAnonymous Guest Posts: 137
    I have a similar problem with the Create Pick

    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?)
  • ara3nara3n Member Posts: 9,258
    What I've seen is that if you are using serialized items, Navision leaves orphaned entries in warehouse serial table, Can't remember the name right now. But hat issue was occurring every time. I saw this in 4.0 but could as well be happening in 3.7
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • TonyHTonyH Member Posts: 223
    Have you tried running the table to see if the lines are in the table but not on the form?

    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 :D )

    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
    If Codeunit.Run
    

    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 :D

    T
Sign In or Register to comment.