Value of control in subform on mainform

SnoT
Member Posts: 2
Hello,
I have a mainform with two subforms. (SubF1 and SubF2)
Both subforms are based on the same object and have a control called Ref.
On the mainform, I'd like to create a third subform that holds a filtered table, based on the two first subforms.
As a first step, I thought to do this by creating a variable that contains the necessary filter. (like = SubF1.Ref|SubF2.Ref ) but already there, I have problems to generate this value.
My question, though, is probably rather sipmle to answer : can I read information in a control on a subform towards a control on a mainform ?
Tnx in advance !
I have a mainform with two subforms. (SubF1 and SubF2)
Both subforms are based on the same object and have a control called Ref.
On the mainform, I'd like to create a third subform that holds a filtered table, based on the two first subforms.
As a first step, I thought to do this by creating a variable that contains the necessary filter. (like = SubF1.Ref|SubF2.Ref ) but already there, I have problems to generate this value.
My question, though, is probably rather sipmle to answer : can I read information in a control on a subform towards a control on a mainform ?
Tnx in advance !
kinda like this site !
0
Comments
-
define a function on subforms's form that returns the value of your variable:
PROCEDURE GetMyValue@1() : Integer; BEGIN EXIT(MySubFormsGlobalToPassToMainForm); END;
Then you can call this function from main form using:ValueFromSF1 := CurrForm.SubF1.FORM.GetMyValue; ValueFromSF2 := CurrForm.SubF2.FORM.GetMyValue;
You can return only simple variable types.®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
If you want to return a complex variable types (like records) then you should change your function:
define a function on subforms's form that has a parameter called by reference. you don't need to use the return var.PROCEDURE GetMyRec@1(VAR MyRecToPass 36); BEGIN MyRecToPass := SubFormsRecToPass; END;
Then you can call this function from main form using:CurrForm.SubF1.FORM.GetMyRec(PassedRec1); CurrForm.SubF2.FORM.GetMyRec(PassedRec2);
®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯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