Copy data from one table to another with filters

Hex
Member Posts: 6
Hi.
Currently I need to maintain some info in one table, and be able to copy this data to another table.
The table structure is like this:
Table 1 (blank)
____________
Table 2 (Main Item)
________________
1
2
3
Table 3 (Item Value)
_________________
1 a
1 b
1 c
Table 1 is the table I need to populate.
Table 2 is the table that holds the main 'item', with a 'subtable' (Table 3) that holds the 'itemvalues'.
When I look up in Table 2 from Table 1, I would like to be able to select e.g. '1', and the values for 1 from Table 3 (a,b,c), should be copied to Table 1, so Table 1 now looks like this:
Table 1
_______
a
b
c
One of the fields in Table 1 is related to 27 Item. So therefore, the values from Table 3, should only be copied to the Item, I have currently looked up.
Thx in advance...
Currently I need to maintain some info in one table, and be able to copy this data to another table.
The table structure is like this:
Table 1 (blank)
____________
Table 2 (Main Item)
________________
1
2
3
Table 3 (Item Value)
_________________
1 a
1 b
1 c
Table 1 is the table I need to populate.
Table 2 is the table that holds the main 'item', with a 'subtable' (Table 3) that holds the 'itemvalues'.
When I look up in Table 2 from Table 1, I would like to be able to select e.g. '1', and the values for 1 from Table 3 (a,b,c), should be copied to Table 1, so Table 1 now looks like this:
Table 1
_______
a
b
c
One of the fields in Table 1 is related to 27 Item. So therefore, the values from Table 3, should only be copied to the Item, I have currently looked up.
Thx in advance...
Who the hell is General Failure, and why is he reading my disk?
0
Comments
-
So table 2 contains template headers, and table 3 template lines/values for table 1. Well, something like this I guess: (Not tested, validate or anything)
OnLoopup(): IF NOT FORM.RUNMODAL(0,Tab2) = Action::LookupOK THEN EXIT; Tab1.DELETEALL; Tab3.SETRANGE("First Field",Tab2."First Field"); IF Tab3.FIND('-') THEN REPEAT Tab1.TRANSFERFIELD(Tab3,TRUE); // Req. the tables are designed for it, otherwise field by field Tab1.INSERT; UNTIL Tab3.NEXT = 0;
PS: I most likely don't understand what you are trying to do - please be a bit more specific :-)Regards
Peter0 -
To be more specific, it is the Variants table that, in this case, is Table 1.
The Template table is, as you say, Table 2. The template lines are in Table 3.
I have made a form using Table 2, with a subform using Table 3.
I have set a filter, so that when select f.x. Code 1 in the form showing Table 2, the values for Code 1 from Table 3 is then shown in the subform.
What I would like to do now, is to Click OK in the form, so that the values from Table 3 for that code, is transferred to the Variants table for the specific Item record that I am currently editing.Who the hell is General Failure, and why is he reading my disk?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