importing objects navision

navisionerin
Member Posts: 161
Hello. I am creating a new database and importing new objects from text files. however i dont want to import them one by one.. is there a way to import them all at one go and if so how? currently i am copying and pasting them all in one .txt file so that i can import them together, but its still slowing me down..
any ideas?
any ideas?
0
Answers
-
Hi @navisionerin,
I use this and it works very well. https://mibuso.com/downloads/nav-object-splitter-v3.0.0.0
With this tool you can split or join NAV txt files.0 -
I have a couple of powershell script to do this:
#Folder Settings $ObjFolder = 'C:\ObjectToImport\' $ArchivePath = 'C:\ObjectToImport\_done\' #Server settings $databaseName = 'MyDatabase' $databaseServer = 'MyServer' $serverInstance = 'DynamicsNAV110' Import-Module 'C:\Program Files (x86)\Microsoft Dynamics NAV\110\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1' -WarningAction SilentlyContinue | out-null Import-Module 'C:\Program Files\Microsoft Dynamics NAV\110\Service\NavAdminTool.ps1' -WarningAction SilentlyContinue | Out-Null $ErrorOccured = $false; $ErrorList = New-Object "System.Collections.Generic.List[String]" $Logpath = $ObjFolder + 'log\' Clear-Host foreach($file in Get-ChildItem $ObjFolder -Filter *.txt) { $filename = ($ObjFolder + $file.BaseName + '.txt') if(Test-Path $filename) { try { Import-NAVApplicationObject -Path $filename -DatabaseName $databaseName -DatabaseServer $databaseServer -NavServerInstance $serverInstance -Confirm:$false -LogPath $Logpath if (( Get-ChildItem $Logpath | Measure-Object ).Count -eq 1) { Move-Item -Path $filename -Destination ($ArchivePath + '\' + $file.BaseName + '.txt') -Confirm:$false } else { $ErrorOccured = $true; } } Catch { $ErrorOccured = $true; $ErrorList.add($_.Exception.Message); } Finally { Remove-Item -Force -Path $Logpath -Recurse -Confirm:$false } } } IF ($ErrorOccured) { Clear-Host Write-Host 'One or more error occured, please manuel import the remaining objects' -BackgroundColor Red if(!$ErrorList.Count -eq 0) { Write-Host 'Errors occured is as following:' -BackgroundColor Red foreach($e in $ErrorList) { Write-Host $e -BackgroundColor Red } } } else { Write-Host 'All objects imported' -BackgroundColor Green }
For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.2
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