Question:about refresh form
 
            
                
                    justeryu                
                
                    Member Posts: 13                
            
                        
            
                    hello guys ,
I have some problems to need your help !
I create a ship line form and have a button on the form.
The button function is refreshed ship line records , and at the same time to chececk
every line : if the same item No.| variant Code that carton no. would be continue increase.
And then different item No.| variant Code to new Calculate carton no..
When user key the wrong carton no. , they can onpush button to refresh field.
Please check my coding where was wrong ?When i onpush first time ,it work but continue
to onpush second time or more, it run error message : does not exist !
G_TmpRecPacking is Temporary variable and view my attachment
another question:
If i want to use CurrForm.UPDATE to refresh the line records ,
only update to Calculate "Carton No. Form" & "Carton No. To" these two Column.
Please teaches me how to do ? thank you so much.
Appreciate anyone who can help me!
JY
                
I have some problems to need your help !
I create a ship line form and have a button on the form.
The button function is refreshed ship line records , and at the same time to chececk
every line : if the same item No.| variant Code that carton no. would be continue increase.
And then different item No.| variant Code to new Calculate carton no..
When user key the wrong carton no. , they can onpush button to refresh field.
Please check my coding where was wrong ?When i onpush first time ,it work but continue
to onpush second time or more, it run error message : does not exist !
OnPush() RefreshPackingLine ;
RefreshPackingLine()
BEGIN
  G_RecPacking.RESET ;
  G_RecPacking.COPY(Rec) ;
  G_TmpRecPacking.DELETEALL ; 
  G_RecPacking.SETCURRENTKEY("Shipping No.","Line No.") ;
  IF G_RecPacking.FINDSET THEN BEGIN
  REPEAT
    IF (G_TmpRecPacking."Item No."<>G_RecPacking."Item No.") OR
       (G_TmpRecPacking."Variant Code"<>G_RecPacking."Variant Code") THEN BEGIN
        G_RecPacking."Carton No. Form" := 1 ;
        G_RecPacking."Carton No. To" := G_RecPacking."Carton No. Form" + G_RecPacking."Total  Carton" -1 ;
        G_RecPacking.MODIFY(TRUE) ;
        G_TmpRecPacking := G_RecPacking ;
        G_TmpRecPacking.INSERT(FALSE) ;
    END ELSE BEGIN
        G_RecPacking."Carton No. Form" := G_TmpRecPacking."Carton No. To" +1 ;
        G_RecPacking."Carton No. To" := G_RecPacking."Carton No. Form" +G_RecPacking."Total  Carton" -1 ;
        G_RecPacking.MODIFY(TRUE) ;
        G_TmpRecPacking."Carton No. To" := G_RecPacking."Carton No. To" ;
        G_TmpRecPacking.MODIFY(FALSE) ;
    END ;
  UNTIL G_RecPacking.NEXT = 0 ;
  END ;
END ;
G_TmpRecPacking is Temporary variable and view my attachment
another question:
If i want to use CurrForm.UPDATE to refresh the line records ,
only update to Calculate "Carton No. Form" & "Carton No. To" these two Column.
Please teaches me how to do ? thank you so much.
Appreciate anyone who can help me!
JY
0                
            Comments
- 
            First off all you should check your code with debugger. Which line causes the problem?
 Basically you could be getting out of dataset or trying to modify a record that does not exist.RefreshPackingLine() BEGIN G_RecPacking.RESET ; G_RecPacking.COPY(Rec) ; G_TmpRecPacking.DELETEALL ; G_RecPacking.SETCURRENTKEY("Shipping No.","Line No.") ; IF G_RecPacking.FINDSET THEN BEGIN // using TRUE parameter is better REPEAT IF (G_TmpRecPacking."Item No."<>G_RecPacking."Item No.") OR // which G_TmpRecPacking? (G_TmpRecPacking."Variant Code"<>G_RecPacking."Variant Code") THEN BEGIN G_RecPacking."Carton No. Form" := 1 ; G_RecPacking."Carton No. To" := G_RecPacking."Carton No. Form" + G_RecPacking."Total Carton" -1 ; G_RecPacking.MODIFY(TRUE) ; G_TmpRecPacking := G_RecPacking ; G_TmpRecPacking.INSERT(FALSE) ; END ELSE BEGIN G_RecPacking."Carton No. Form" := G_TmpRecPacking."Carton No. To" +1 ; G_RecPacking."Carton No. To" := G_RecPacking."Carton No. Form" +G_RecPacking."Total Carton" -1 ; G_RecPacking.MODIFY(TRUE) ; G_TmpRecPacking."Carton No. To" := G_RecPacking."Carton No. To" ; G_TmpRecPacking.MODIFY(FALSE) ;// which G_TmpRecPacking? END ; UNTIL G_RecPacking.NEXT = 0 ; END ; END ;
 I couldn't get the last question. You want to update only two columns or only two columns are updated?Ufuk Asci
 Pargesoft0
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
