Problem In Dataport Import From Fixed Length File
JohnieG
Member Posts: 56
Hi to all,
I am new in Navision and I am trying to create my first dataport in Navision 4 SP2.
I am trying to insert from a fixed length file some records to the Item table. The dataport has the AutoUpdate Property set to Yes in order to update items which are already inserted instead of overwritting them. My problem is that the Item No. field is constructed by two separated fields from the source file. I am importing these fields (ItemNo1 and ItemNo2) into some global text variables which later on are used to construct the new ItemNo. as follows:
Item."No." := ItemNo1 + ItemNo2;
If i place this code in the OnBeforeImportRecord trigger then the first inserted item has a null Item No. and the AutoUpdate property seems to work.
On the other hand, if i place it in the OnAfterImportRecord trigger, no matter how many records the file has i am only succeding in inserting the first one and the AutoUpdate property seems disabled.
What am I doing wrong? Is there any more code that needs to be added? Any suggestion is more than welcome!
Thanks in advance...
I am new in Navision and I am trying to create my first dataport in Navision 4 SP2.
I am trying to insert from a fixed length file some records to the Item table. The dataport has the AutoUpdate Property set to Yes in order to update items which are already inserted instead of overwritting them. My problem is that the Item No. field is constructed by two separated fields from the source file. I am importing these fields (ItemNo1 and ItemNo2) into some global text variables which later on are used to construct the new ItemNo. as follows:
Item."No." := ItemNo1 + ItemNo2;
If i place this code in the OnBeforeImportRecord trigger then the first inserted item has a null Item No. and the AutoUpdate property seems to work.
On the other hand, if i place it in the OnAfterImportRecord trigger, no matter how many records the file has i am only succeding in inserting the first one and the AutoUpdate property seems disabled.
What am I doing wrong? Is there any more code that needs to be added? Any suggestion is more than welcome!
Thanks in advance...
Always Look On The Bright Side Of Life...
0
Comments
-
Set AutoSave to "No", do all that needs to be done in the OnAfterImportTrigger and then insert ( or modify) the record manually at the end of this trigger.Kai Kowalewski0
-
Thanks a lot! I think that this is the solution!Always Look On The Bright Side Of Life...0
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 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
