Codeunit 7307 Whse.-Activity-Register Code() hangs

Consider Codeunit 7307 Whse.-Activity-Register. Its trigger Code()'s execution sometimes leads to a Navision client hang. Here is the code: Code(): ............. // Register lines SourceCodeSetup.GET; LineCount := 0; IF RECORDLEVELLOCKING THEN WhseActivLine.LOCKTABLE; IF WhseActivLine.FIND('-') THEN BEGIN CreateRegActivHeader(WhseActivHeader); REPEAT LineCount := LineCount + 1; IF NOT HideDialog THEN BEGIN Window.UPDATE(3,LineCount); Window.UPDATE(4,ROUND(LineCount / NoOfRecords * 10000,1)); END; IF Location."Bin Mandatory" THEN RegisterWhseJnlLine(WhseActivLine); CreateRegActivLine(WhseActivLine); UNTIL WhseActivLine.NEXT = 0; END; ........... Everytime the code execution hangs on the different steps - lines of the REPEAT/UNTIL statement. We use Navision 3.70A and It is a default code - we haven’t done any customizations there. What is the cure? Any suggesions would be very much appreciated. Thanks in advance.

Do you have set up the “Bin Mandatory” for the location ? Did you change anything in the functions called in that loop ? Did you change anything in any codeunits or other subsequent functions getting called from there ?

  1. Do you have set up the “Bin Mandatory” for the location ? Yes. 2. Did you change anything in the functions called in that loop ? No. 3. Did you change anything in any codeunits or other subsequent functions getting called from there ? No.

Try to put in a confirm just after the REPEAT: IF CONFIRM('Line No. %1 is going to be processed. Do you want to interrupt,FALSE,WhseActivLine."Line No.") THEN ERROR('STOP'); before calling the CU you need to check how many lines there are (in the document to be registered and what the highest line number is. I bet that you will see the confirm popping up more often than you expect. Could you try that and reply with the results ?