Set subformview programmatically

tompynation
Member Posts: 398
Hi,
How could i set a subformview in the OnAfterValidate of a recordfield from the mainform?
The subform should also only get visible, when this RecordField gets validated...
How could i set a subformview in the OnAfterValidate of a recordfield from the mainform?
The subform should also only get visible, when this RecordField gets validated...
0
Answers
-
if you specify a filter for filter group 3 you should be able to change this at runtime.0
-
i dont know that... :roll:
How should i set the filtergroup for the subform?0 -
i found on the forum this to set the filter group:
SETFILTER("Customer Name",'ABC*');
FILTERGROUP(6);
SETFILTER("Customer Name",'*XYZ*');
FILTERGROUP(0);
Do i have to call this code inside the subform ?
Or just execute this in the main form?0 -
Give name to the subform control, and than check the
CurrForm.<MySubformName>.FORM.SETTABLEVIEW()
function for how to set the filters on the subform...0 -
i cannot use the settableview cause i can only pass a record to this function...
In my subform there is a tablebox which shows all record from the table Recept.
This table contains the Field ReceptID.
Now i like to filter the subform to show only the records who correspond to a given ReceptID
How to do that0 -
The function is passing filters not record... may be I do not understand correctly, but you just needs one variable of type record for same table as the subform is based on, set the requested filters (e.g. on the Receipt ID field) and pass these filters by passing this variable as parmeter of the function described above...0
-
aha, now i see what you mean.
Its sort of working now using this code:
lv_Length := STRLEN(Productcode);
IF lv_Length > 0 THEN BEGIN
lv_ReceptID := GetReceptID(Productcode);
lv_ReceptItem.SETFILTER(lv_ReceptItem.ReceptID,'%1',lv_ReceptID);
CurrForm.POProductFormuleSub.FORM.SETTABLEVIEW(lv_ReceptItem);
CurrForm.POProductFormuleSub.FORM.VISIBLE := TRUE;
END
ELSE IF lv_Length = 0 THEN BEGIN
CurrForm.POProductFormuleSub.FORM.VISIBLE := FALSE;
END;
The only problem is the update of the subform now...0 -
Update of the subform was solved many times on this forum... just add something like UpdateForm function on the subform calling the CurrForm.UPDATE(False); and call this function from the main form...0
-
update is working now, i forget to pass the FALSE attribute to the UPDATECONTROLS... ](*,)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