AL icon indicating copy to clipboard operation
AL copied to clipboard

Import-NAVApplicationObject throws "not a valid date error"

Open StijnBt opened this issue 8 years ago • 1 comments

Hello,

I'm experiencing a problem with the Import-NAVApplicationObject powershell command on MS Dynamics NAV Tenerife Version W1 12.1 Build 12.1.22475.22720

This is what I did:

  1. Made an export of standard object, ex. table 18 Customer to text
  2. Tried to import it with the following powershell script

`Copy-FileToNavContainer -containerName "testbuild" -localPath "C:\Users\Administrator\Documents\t18.txt" -containerPath "c:"

$session = Get-NavContainerSession -containerName "testbuild" -silent

Invoke-Command -Session $session -ScriptBlock {

Write-Host "in container"

Import-NAVApplicationObject -Path "c:\t18.txt" -DatabaseName CRONUS -DatabaseServer "TESTBUILD\SQLEXPRESS" -ImportAction Overwrite -SynchronizeSchemaChanges Force -NavServerName localhost -NavServerInstance NAV -NavServerManagementPort 7045 -Confirm:$false

}`

Result:

Copy C:\Users\Administrator\Documents\t18.txt to container testbuild (c:\) in container : [86573217] '15/06/18;' is not a valid date. [0] The import stopped at line 5. + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Import-NAVApplicationObject + PSComputerName : 23ecd9babe62a9538bc9b17aa63651733fba3a70fdaffd2af8b8645c05742a02

If I import the same file with the classic dev env. there's no problem.

Please advise.

Best regards,

Stijn

StijnBt avatar Jun 23 '18 07:06 StijnBt

I think this is a non-issue. Since I was experimenting with docker containers and forgot to set the correct DateTime culture settings. Once I created the docker container with the right culture settings the problem disappeared. So the issue may be closed, my apologies for any inconvenience.

https://github.com/Microsoft/navcontainerhelper/issues/58

StijnBt avatar Jul 15 '18 08:07 StijnBt