How to import the date using Dataport ?

avgavhane
Member Posts: 12
Dear users,
i want to import the data from more than one table using Dataport.
[-o<
i want to import the data from more than one table using Dataport.
[-o<
0
Comments
-
I do not understand what you want...
You have one file with data for two tables? How they are organized in the file (structure of the file)?
Or you need read the file and split the data into two tables?
Pls, more info... more info = more precise answer0 -
Using dataports, you can only import multiple tables if you have all of the records of each table in groups of lines in your text file. If you have groups of lines structured as one record and then a group of other related records, that's not possible.
Possible:Table1.Rec1 Table1.Rec2 Table1.etc.... Table2.Rec1 Table2.Rec2 Table2.Etc
Not possible:Table1.Rec1 --Table2.Rec --Table2.etc Table1.Rec2 --Table2.Rec --Table2.etc
0 -
I do it all the time using variables and code.
Select the primary table that you import into.
For your import file, you will have fields from your primary table and one or more related tables. For the dataport fields, select fields from the primary table as appropriate. For fields from the other tables, create variables of the same type and size. Set those variables as the dataport fields in the sequence so as to match your import file.
Create record variables for the one or more related tables.
In the onafterimport record trigger for the primary table, locate the appropriate record using SETRANGE or SETFILTER and the corresponding field(s) from the primary table. Update fields from the variables, and MODIFY the record. OR INSERT if adding new records.0 -
Yes but that is different. You have one line with values targeted for multiple tables, and all your lines are the same. This would not work with a variable number of sales lines per sales header.
For instance, you have a sales order with one line and you have a sales order with 15 lines. The way you are describing won't work, unless you have enough fields in your dataport fields to account for that many lines.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