Codeunit 7307 Whse.-Activity-Register Code() trigger hangs
 
            
                
                    DeSp                
                
                    Member Posts: 105                
            
                        
            
                    Consider Codeunit 7307 Whse.-Activity-Register. Its trigger Code()'s execution sometimes leads to a Navision client hang.  Here is the code:
Code():
Everytime 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.
                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 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.
Nil desperandum
0                
            Comments
- 
            I will sugest some actions to do. First one - run database test.
 Have you tried on different PCs? If you are using server, try to create backup and run on local PC.
 I feel that you have some problem with PS hardware 0 0
- 
            Yes, we use the SQL 2k Server to run the database and this issue appears in the multi-user environment and on different PC's. I couldn't repeat it on the local PC.Nil desperandum0
- 
            It means, on Native server is no problem and on MS SQL server is?0
- 
            No, kine, I mean I used the db locally on one PC - single-user mode. We don't use the Native server - we use the SQL Server. Have you already met this issue with the Native server?Nil desperandum0
- 
            I think, that it can be the problem of MS SQL, when sometime is not able to find some entry (it seems like the entry is for MS SQL "invisible" - you can see it when you apply all filters manually, but in the code the NEXT will not find it etc.). Solution for this kind of problem can be the to set diagnostics property on MS SQL by executing this SQL query:UPDATE [$ndo$dbproperty] SET diagnostics = 131072 0
- 
            kine, I 've already had this value there - you helped me with it about several months ago. So, I guess, unfortunately, it is not the cure for this issue.                        Nil desperandum0 So, I guess, unfortunately, it is not the cure for this issue.                        Nil desperandum0
- 
            Ah, sorry... :-) I forgot...;-)
 Ok, than it seems that problem is somewhere in this lines:RegisterWhseJnlLine(WhseActivLine); CreateRegActivLine(WhseActivLine);
 if it is neverending loop, it seems, like the WhseActivLine is modified somewhere in this functions and it corrupt the loop (like change of filtered field etc...)0
- 
            if it is neverending loop, it seems, like the WhseActivLine is modified somewhere in this functions and it corrupt the loop (like change of filtered field etc...)
 It seems like all is correct. The loop is not corrupted.Nil desperandum0
- 
            And did you check, that in case of "freezing" isn't the user locked by another user? (waiting for lock, "blocked" in session table)0
- 
            Yes, I checked it - the user wasn't locked (blocked) by anyone.Nil desperandum0
- 
            Hi DeSP
 Perhaps there is a bug in the standard coding because as I see it in the following codeWITH WhseActivHeader DO BEGIN WhseActivLine.SETRANGE("Activity Type",WhseActivLine."Activity Type"); WhseActivLine.SETRANGE("No.",WhseActivLine."No."); WhseActivLine.SETFILTER("Qty. to Handle",'<>0');
 should this range not be set to the WhseActivHeader record
 ieWITH WhseActivHeader DO BEGIN WhseActivLine.SETRANGE("Activity Type",[color=indigo]WhseActivHeader[/color]."Activity Type"); WhseActivLine.SETRANGE("No.",[color=indigo]WhseActivHeader[/color]."No."); WhseActivLine.SETFILTER("Qty. to Handle",'<>0');
 Just a suggestion :-k0
- 
            I don't think its a bug.Nil desperandum0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 323 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions


