Multi subforms

HenningTh
Member Posts: 59
Have a problem which seems to be difficult to solve:
Having a main-form containing 2 sub-forms. These 2 subforms refers to 2 different tables. When I call the mainform I have 2 variables for filtering (one variable for each of the subs).
To use SETTABLEVIEW and SETRECORD for each of the subforms gives an error when calling the main-form - you are not allowed to use more than one.
HAve elaborated over this, but cannot find the solution - anyone who can? Would be very greatfull for any help on this matter.
Having a main-form containing 2 sub-forms. These 2 subforms refers to 2 different tables. When I call the mainform I have 2 variables for filtering (one variable for each of the subs).
To use SETTABLEVIEW and SETRECORD for each of the subforms gives an error when calling the main-form - you are not allowed to use more than one.
HAve elaborated over this, but cannot find the solution - anyone who can? Would be very greatfull for any help on this matter.
0
Comments
-
I don't see any problems with your setup, you should be able to link 2 subforms to one main form easily, either via the subformlink or via functions in the subforms you can cal to set your filters. What problems are you experiencing exactly, and can you show us any code ?0
-
MBerger wrote:I don't see any problems with your setup, you should be able to link 2 subforms to one main form easily, either via the subformlink or via functions in the subforms you can cal to set your filters. What problems are you experiencing exactly, and can you show us any code ?
I think he has a main form with a subform and in that subform a second subform, which is not allowed in NAV. So not a form with two subforms, but a form with a subform, which has a subform on it.0 -
Have rechecked my code - a little embarrassed to admit a spellig flaw :oops:
No error anymore, but subform 1 (LocalStock) shows correct limited view - but subform2 (vendorstock) just shows all existing items (no filter).
MainStockform contains both LocalForm and Vendorform
Code:
IF "Own product" <> '' THEN
BEGIN
LocalStock.SETRANGE(Productkode,"Local product");
IF LocalStock.FINDFIRST THEN
BEGIN
LocalForm.SETTABLEVIEW(LocalStock);
LocalForm.SETRECORD(LocalStock);
END;
END;
IF "Produkt-ID" <> '' THEN
BEGIN
VendorStock.SETRANGE(ProductID,"Produkt-ID");
IF VendorStock.FINDFIRST THEN
BEGIN
VendorForm.SETTABLEVIEW(VendorStock);
VendorForm.SETRECORD(VendorStock);
END ELSE
CLEAR(VendorForm);
END;
MainStockform.run;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