0

I tried update NAV2018 using *.txt files first. But it requires some packages as for development. So i tried update NAV2018 with exported *.fob:

Import-Module "${env:ProgramFiles(x86)}\Microsoft Dynamics NAV\110\RoleTailored Client\NavModelTools.ps1" -WarningAction SilentlyContinue | Out-Null

Import-NAVApplicationObject -Path D:\work\namise.fob -DatabaseName NAV2018 -LogPath D:\work -SynchronizeSchemaChanges force -Confirm:$false

pause

But errors was shown and command was not processed succesfully. Is command Import-NAVApplicationObject ekvivalent for manual import proces? Can be used for *.fob too?

Open Microsoft Dynamics NAV Development Environment -> Click File -> Click Import -> Select *.fob -> Message shown: The objects in D:\work\namise.fob could not be imported because there are objects already in the database with conflicting versions. Choose OK to open the Import Worksheet, or Cancel to stop the import. -> Click OK -> Click Replace All -> Click OK -> Click Synchronize Schema Force (Changed will be synchronized to the database table without validation. Data in table column that are affected by the changes will be deleted) -> Click Synchronizate changes to the corresponding tables in SQL Server Yes -> Use from select All table schema changes were synchronized with force -> Shown table where is Import completed (replaced XY) -> then restart NAV services -> Done

If is command Import-NAVApplicationObject equal to mentioned manual process. What does mean these errors? Are solvable?

Thank you a lot!

Kind regards

Lukas

ldrahnik
  • 3
  • 3

1 Answers1

0
  1. Yes the comandlet is a complete copy of the manual process. It is just a wrapper that uses finsql.exe (development environment) to run the process.
  2. You need to use ImportAction parameter with value Overwrite https://learn.microsoft.com/en-us/powershell/module/microsoft.dynamics.nav.ide/import-navapplicationobject?view=businesscentral-ps
  3. DO NOT SYNC SCHEMA WITH FORCE. You will lose any data in the columns that has a destructive changes.

The value for parameter you can find from autocomplete feature (Ctrl+Space) of powershell terminal or from description of finsql.exe parameters (as I mentioned the cmdlet is only wrapper around dev environment executable file).

enter image description here

Mak Sim
  • 2,148
  • 19
  • 30
  • Where from you know value ```Overwrite``` for ```ImportAction``` parameter? In the posted documentation it is not mentioned. Thank you a lot Mak Sim! – ldrahnik Dec 01 '20 at 20:50
  • Updated the answer – Mak Sim Dec 02 '20 at 06:56
  • Thank you! What do you think is best way check *fob import was done successfully? I use at this moment: ```Start-Process -FilePath "C:\Program Files (x86)\Microsoft Dynamics NAV\110\RoleTailored Client\Microsoft.Dynamics.Nav.Client.exe" -ArgumentList "dynamicsnav://:/DynamicsNAV//"``` but it requires manual enter click. I would like automate that. Don't you know is possible obtain information about Spooler Manager rows? Or what do you think? – ldrahnik Dec 02 '20 at 18:53
  • That depends on what you mean by “successfully”. If cmdlet thrown no error then import was successful. If you want to verify that application works then you need to do it on testing environment before upgrade. There is no way to be sure that nothing else broken. Also pay attention to point 3 in the answer. If you care about the result you must sync schema with Sync mode and write upgrade codeunits for breaking changes. – Mak Sim Dec 03 '20 at 04:41