dataport - Importing identical records problem

TomasStulpinas
Member Posts: 7
hi,
i've got a file for import which contains identical lines. when i import, i want all records (including identical) appear in my table. i've added an extra column in table, named it 'No.' and made it primary key. Still, navision removes duplicated lines.
what can be done about this?
i've got a file for import which contains identical lines. when i import, i want all records (including identical) appear in my table. i've added an extra column in table, named it 'No.' and made it primary key. Still, navision removes duplicated lines.
what can be done about this?
0
Comments
-
In addition to adding a column and making it the primary key, you also need to generate unique values for this field.0
-
I've set 'No.' property 'AutoIncrement' to 'yes', too. this did not help.0
-
I haven't gotten autoincrement to work, so I wouldn't even try that again. Since it is REALLY easy to program it yourself, I didn't really give it much effort either.0
-
DenSter wrote:I haven't gotten autoincrement to work, so I wouldn't even try that again. Since it is REALLY easy to program it yourself, I didn't really give it much effort either.
well, i simply wrote a trigger in my dataport. next time i simply won't bother with autoincrement (by the way, if i try to enter data in my table manually, autoincrement works fine)0 -
When the dataport runs it uses Rec.INIT to initialize each new record. INIT does not reset the primary key fields.
Result:
First Record (before insert):
Key Field = NULL
First Record (after insert):
Key Field = 1
Second Record (before insert):
Key Field = 1
Second Record (on insert):
Error - Primary key exist
You must clear the primary key values (CLEAR(Rec)) for each new record.There are no bugs - only undocumented features.0 -
Hello,
In which trigger should I write CLEAR(Rec) for reset Autoincrement?
I have a text file tab delimited with 3 records, NAV 5.0 and SQL 2005.
When I import it I don't have any error message but only the last record is in the table.
Is this the problem?
Thank you0 -
why not onimport record
UniqueKey := UniqueKey +1;
is it a one time import or something you are going to use alot?0 -
I solved the problem with this code in onBeforeImportRecord
XXX_Rec - OnBeforeImportRecord()
CLEAR(XXX_Rec);
Thank you0
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