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.
0
Comments
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.
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;