Import-NAVApplicationObject

Imports Business Central application objects from a file into a database.

Syntax

Import-NAVApplicationObject
      [-Path] <String[]>
      [-DatabaseName] <String>
      [-DatabaseServer <String>]
      [-LogPath <String>]
      [-ImportAction <String>]
      [-SynchronizeSchemaChanges <String>]
      [-NavServerName <String>]
      [-NavServerInstance <String>]
      [-NavServerManagementPort <Int16>]
      [-SuppressBuildSearchIndex]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Import-NAVApplicationObject
      [-Path] <String[]>
      [-DatabaseName] <String>
      [-DatabaseServer <String>]
      [-LogPath <String>]
      [-ImportAction <String>]
      [-SynchronizeSchemaChanges <String>]
      -Username <String>
      -Password <String>
      [-NavServerName <String>]
      [-NavServerInstance <String>]
      [-NavServerManagementPort <Int16>]
      [-SuppressBuildSearchIndex]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Import-NAVApplicationObject function imports the objects from the specified file(s) into the specified database. When multiple files are specified, finsql is invoked for each file. For better performance the files can be joined first. However, using seperate files can be useful for analyzing import errors.

Examples

EXAMPLE 1

Import-NAVApplicationObject MyAppSrc.txt MyApp

This command imports all application objects in MyAppSrc.txt into the MyApp database.

EXAMPLE 2

Import-NAVApplicationObject MyAppSrc.txt -DatabaseName MyApp

This command imports all application objects in MyAppSrc.txt into the MyApp database.

EXAMPLE 3

Get-ChildItem MyAppSrc | Import-NAVApplicationObject -DatabaseName MyApp

This commands imports all objects in all files in the MyAppSrc folder into the MyApp database. The files are imported one by one.

EXAMPLE 4

Get-ChildItem MyAppSrc | Join-NAVApplicationObject -Destination .\MyAppSrc.txt -PassThru | Import-NAVApplicationObject -Database MyApp

This commands joins all objects in all files in the MyAppSrc folder into a single file and then imports them in the MyApp database.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DatabaseName

Specifies the name of the database into which you want to import.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DatabaseServer

Specifies the name of the SQL server instance to which the database you want to import into is attached. The default value is the default instance on the local host (.).

Type:String
Position:Named
Default value:.
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ImportAction

Specifies the import action. The default value is 'Default'.

Type:String
Position:Named
Default value:Default
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LogPath

Specifies the log folder.

Type:String
Position:Named
Default value:"$Env:TEMP\NavIde\$([GUID]::NewGuid().GUID)"
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NavServerInstance

Specifies the Business Central Server instance that is being used.The default value is DynamicsNAV90.

Type:String
Position:Named
Default value:DynamicsNAV90
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NavServerManagementPort

Specifies the port on the Business Central Server server that the Business Central Windows PowerShell cmdlets access. The default value is 7045.

Type:Int16
Position:Named
Default value:7045
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NavServerName

Specifies the name of the server that hosts the Business Central Server instance, such as MyServer.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Password

The password to use with the username parameter to authenticate to the database. If you do not specify a user name and password, then the command uses the credentials of the current Windows user to authenticate to the database.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Path

Specifies one or more files to import.

Type:String[]
Aliases:PSPath
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SuppressBuildSearchIndex

Specifies whether the build of the Search Index needs to be suppressed.

Type:SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SynchronizeSchemaChanges

Specifies the schema synchronization behavior. The schema synchronization will run against all objects in the database, not just the objects that you import.

'no' specifies not run schema synchronization.

'yes' specifies to run schema synchronization with validation, which means that if there are destructive changes in any objects in the database, the synchronization wil fail. This is the default value.

'force' specifies to run schema synchronization without validation. For destructive changes, data in columns of the business data table that are affected by changes will be deleted.

Type:String
Position:Named
Default value:Yes
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Username

The user name to use to authenticate to the database. The user name must exist in the database. If you do not specify a user name and password, then the command uses the credentials of the current Windows user to authenticate to the database.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String[]

You can pipe a path to the Import-NavApplicationObject function.

Outputs

None