Dataport - assign the next available number

shane
Member Posts: 20
I’m working through importing data into Navision 4.0 SP1 using the dataport functionality. I have run into one problem that I can’t seem to find an answer to after searching the forms and reading the Application Designer’s Guide. Perhaps I just missed it….
Regardless, here is my problem:
I have the Item Card setup to automatically assign the next available number for item numbers. I wish to import records from an Excel spreadsheet and have Navision assign the Item Number “No.”.
I have set the “AutoSave” and “AutoUpdate” to “No” for the Dataport and I assume that I now need to add some code to one of the triggers to facilitate the Item Number increment, and then trigger the insert. This is where I am a little lost.
Any advice would be greatly appreciated.
Regardless, here is my problem:
I have the Item Card setup to automatically assign the next available number for item numbers. I wish to import records from an Excel spreadsheet and have Navision assign the Item Number “No.”.
I have set the “AutoSave” and “AutoUpdate” to “No” for the Dataport and I assume that I now need to add some code to one of the triggers to facilitate the Item Number increment, and then trigger the insert. This is where I am a little lost.
Any advice would be greatly appreciated.
0
Comments
-
itemTmp."No." := '';
itemTmp.insert(true);
itemTmp.Description := item.Description;
<etc>
itemTmp.modify(true);
This will use the default template (usually 999999) and generate a number for you
and set autosave and autoupdate to falseNavision developer0 -
Thank you. This works, I added the suggested code to the “OnAfterImportRecord()” trigger and had to create a local Variable called “itemTmp” of DataType “Record” and SubType “Item”.
Not sure if this is all correct… I still have a lot to lean. But like I said, it works. Thanks again.0 -
it is correct!Navision developer0
-
Actually, if the No. Series is configured to be automatic (default checked, manual unchecked) and you insert with a blank No. it should get a new number automatically, without coding...
Do It Yourself is they key. Standard code might work - your code surely works.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