Moving form record based on subform record selection

jks
Member Posts: 277
Hi all,
My form contains one subform. Source table for form and subform is same. suppose table name is 'Test'.
Table 'Test' contains 10 records. Detail of each record i am displaying on form and all the records i am displaying on subform.(with some important field of table 'Test')
What i want is whenever i point a particular record in a subform, detail information of that record should get displayed on the form. For that I have created one function in my form i.e. moverecord. I have handled OnAfterGetCurrRecord trigger of subform. My code is below:
OnAfterGetCurrRecord() [Event of subform]
dong.moverecord(value);
dong is a variable of type Form.
moverecord(value : Integer) [Function on form]
dongrecord.get(value);
Rec:=dongrecord;
value is the value of primary key.
But record doesn't move. If i write
dongrecord.get(//Some Constant value of primary key)
Rec:=dongrecord;
in OnAfterGetCurrRecord trigger of form then i am getting the record.
Please help.
My form contains one subform. Source table for form and subform is same. suppose table name is 'Test'.
Table 'Test' contains 10 records. Detail of each record i am displaying on form and all the records i am displaying on subform.(with some important field of table 'Test')
What i want is whenever i point a particular record in a subform, detail information of that record should get displayed on the form. For that I have created one function in my form i.e. moverecord. I have handled OnAfterGetCurrRecord trigger of subform. My code is below:
OnAfterGetCurrRecord() [Event of subform]
dong.moverecord(value);
dong is a variable of type Form.
moverecord(value : Integer) [Function on form]
dongrecord.get(value);
Rec:=dongrecord;
value is the value of primary key.
But record doesn't move. If i write
dongrecord.get(//Some Constant value of primary key)
Rec:=dongrecord;
in OnAfterGetCurrRecord trigger of form then i am getting the record.
Please help.
0
Comments
-
Hi,
Have you tried to put a tablebox and a tab control on the same form?
You can then browse through the records and view detailed information at the same time.
Just take a card form and add a table box to it, and see the results.0 -
I placed a table box on a card. and assigned id of the table box to TableBoxID property of a form. But table box is not populated with the data.
Do i need to set some other properties?
I searched forum. but was unable to find the solution.
Please help.0 -
Just add the fields like you normaly do when you add columns to a tabular form. Use the field menu.0
-
- Start Object designer.
- Create New Form
- Select Table Name : I.e. Sales Header.
- Check Create Form Using a wizzard and select Create Tabular Type form
- Select the fields u want in the list.
- Press Finish.
- Now your are in screen design mode.
- Increase the heigth of the screen.
- Move the table box to the bottom.
- Go to field menu, select fields you want to add to the detail.
Press CTRL+R et voila \:D/
If you do not have enough room for all detail fields simply drop a TabControl first...
Have fun!
PeterPeter Wijntjes
MBS NAV Consultant0 -
Hi all,
It works perfectly. But in the current situation , my subform is linked with my form with some condition. i.e my subform and form both display only those records where userid="test" . How can i achieve this with table box?0 -
You can just put this in the sourcetableview property or add it to the OnOpenForm in code.
Just remember the same code and properties go for the normal fields and the tablebox.0 -
It works perfectly now.
Thanks for your replies.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