microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
385 stars 246 forks source link

Metadata is not in sync for table with id xx #223

Closed svwfr closed 6 years ago

svwfr commented 6 years ago

Hi, I have a docker for NAV2017 CU2 -NO, and use NavUserPassword. I have inserted Fob's from a customer db and compiled them by Compile-ObjectsInNavContainer. Thereafter I imported customers company backup as .navdata file.

Almost everything is working exept that the table 27 (item) need to sync the metadata. As I cannot do it from Developer because of use of NavUserPassword, and thereby cannot then run the nav-service to sync Metadata. My question, can I do this "Sync Metadata" or "Sync. Schema for all tables -force" from a PowerShell command?

freddydk commented 6 years ago

New-NavContainer will leave a few icons on the desktop. One of these is a PowerShell Cmd prompt, which open powershell inside the container. In this you have all NAV cmdlets available. Sync-NavTenant or Sync-NavTenantDatabase - not sure which one you need to use. In PowerShell you would do

$session = Get-NavContainerSession -containerName $containerName
Invoke-Command -Session $session -ScriptBlock { 
    Sync-NavTenant ...
}
svwfr commented 6 years ago

Hi Freddy, thanks for fast response and good input. I must admit I am not used to PowerShell, and had hard time to use Your example. But I had Luck With this command: sync-NAVTenant -serverinstance NAV -Mode ForceSync from Your PowerShell-promt. So now I could access the Item table. 💃