Subform update issue

poppins
Member Posts: 647
Hi everyone,
I am trying to transform a Matrix Form into two forms: a main form with a subform control and a subform with a tab box control to replace the matrix...
The original matrix form has in its header 4 text fields that represent the four filters controlling the data displayed in the matrix...
For each of these fields, the following function EditFilters() is called on the OnAfterValidate trigger of the control:
I tried to examine the code of some standard forms that did the same transformation as the one I am trying to do...
I wrote the following function, UpdateMatrixSubform() update the subform:
Here is the code of the Load() Function:
I am calling the function UpdateMatrixSubform() in the trigger OnAfterValidate, after the call of the function EditFilters().
The problem is that the subform does not update, it does not respond when I modify the filters, the data remains the same...
What should I do???
I am trying to transform a Matrix Form into two forms: a main form with a subform control and a subform with a tab box control to replace the matrix...
The original matrix form has in its header 4 text fields that represent the four filters controlling the data displayed in the matrix...
For each of these fields, the following function EditFilters() is called on the OnAfterValidate trigger of the control:
RESET; IF Filtre1<>'' THEN BEGIN IF TypeA=0 THEN SETRANGE("A",Filtre1) ELSE BEGIN Nvl.RESET; Nvl.SETRANGE("Cnl",Filtre1); Nvl.FIND('-'); SETFILTER(NumLi,'%1..%2',Nvl.NumL,(Nvl.NumL+POWER(100,Nvl."Type")-1)); SETFILTER("A",'<>%1',''); END; END; IF Filtre2<>'' THEN SETRANGE("E.Code",Filtre2); IF Filtre3<>0 THEN SETRANGE("R",Filtre3-1); IF Filtre4<>'' THEN SETRANGE("M.",Filtre4); CurrForm.UPDATE(FALSE);
I tried to examine the code of some standard forms that did the same transformation as the one I am trying to do...
I wrote the following function, UpdateMatrixSubform() update the subform:
CurrForm.MatrixForm.FORM.Load(Filtre1,Filtre2 ,Filtre3,Filtre4,MatrixColumnCaptions,MatrixRecords,CurrSetLength);
Here is the code of the Load() Function:
Filtre1 := Filtre1_1; Filtre2 := Filtre2_1; Filtre3 := Filtre3_1; Filtre4 := Filtre4_1; COPYARRAY(MATRIX_ColumnCaption,MatrixColumns1,1); FOR i := 1 TO ARRAYLEN (MatrixRecords) DO MatrixRecords[i].COPY(MatrixRecords1[i]); MATRIX_NoOfMatrixColumns := NoOfMatrixColumns1;
I am calling the function UpdateMatrixSubform() in the trigger OnAfterValidate, after the call of the function EditFilters().
The problem is that the subform does not update, it does not respond when I modify the filters, the data remains the same...
What should I do???
0
Comments
-
It seems that the problem is in the Load() function...
When I defined it, I assigned Filtre1_1, Filtre2_1, Filtre3_1 and Filtre4_1 as parameters...
I tried to debug my code, I noticed that Filtre1_1, Filtre2_1, Filtre3_1 and Filtre4_1 are updated when I change the values of the filters in the form but not Filtre1, Filtre2, Filtre3 and Filtre4...
In other words, the parameters from the form are not correctly transmitted to the subform...
Why is that??? and how can I correct it???0
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
- 320 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