Linking Maintable to Subtable
unplugged
Member Posts: 4
Hi folks,
I have just a simple problem I found no answer in this forum.
Two Tables
01 Maintable the primary key is an code, every entry may has few subtable-entries
02 Subtable
Two Forms
01 The mainform has a 02 subform (subtable-items) which shows all subtable-entries concerning the mainform-item
I'd linke to create a new entry in the subform but the new entry needs the info from what main-item it is created (the subtable-entry should belong to the main-entry)
I need some code like:
In the sub-form OnNewRecord: subtable.trigger_to_maintable_item :=main_entry_code
I have just a simple problem I found no answer in this forum.
Two Tables
01 Maintable the primary key is an code, every entry may has few subtable-entries
02 Subtable
Two Forms
01 The mainform has a 02 subform (subtable-items) which shows all subtable-entries concerning the mainform-item
I'd linke to create a new entry in the subform but the new entry needs the info from what main-item it is created (the subtable-entry should belong to the main-entry)
I need some code like:
In the sub-form OnNewRecord: subtable.trigger_to_maintable_item :=main_entry_code
0
Answers
-
Go to the properties for the subform, and select the sub form and link properties. This will automatically create the foreign keys on the subform. Take a look at the invoice card to see how this is done specifically.*************************************
NAV, CRM, MOSS, CMS, Commerce Server
Justin King
Brulant, Inc
www.brulant.com
justin.king at brulant.com0 -
Hi jekingcom,
Thanks for your reply.
My settings in the main-form - here the sub-form-properties:
SubFormID: MySubform-ID
SubFormView: emty
SubFormLink: Main-Table-PrimaryKey=FIELD(Sub-Table-PrimaryKey)
The sub-entries are not filled with the reference-main-table-entry...
The invoice card? No card is named so. Sorry, I am a beginner...0 -
Bloody beginner's mistake. :roll:
In the sub-table should exist a key like subform-pk,reference-field-to-main-table (example table 43)
Right now it works fine without tranfering data from the main-form to the subform, even though it would be possible by a sub-table-function which is called by the main-form... :whistle:0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions