Export-NAVApplicationObject

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

Syntax

Export-NAVApplicationObject
      [-DatabaseName] <String>
      [-Path] <String>
      [-DatabaseServer <String>]
      [-LogPath <String>]
      [-Filter <String>]
      [-Force]
      [-ExportTxtSkipUnlicensed]
      [-ExportToNewSyntax]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Export-NAVApplicationObject
      [-DatabaseName] <String>
      [-Path] <String>
      [-DatabaseServer <String>]
      [-LogPath <String>]
      [-Filter <String>]
      [-Force]
      [-ExportTxtSkipUnlicensed]
      [-ExportToNewSyntax]
      -Username <String>
      -Password <String>
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Export-NAVApplicationObject function exports the objects from the specified database into the specified file. A filter can be specified to select the application objects to be exported.

Examples

EXAMPLE 1

Export-NAVApplicationObject MyApp MyAppSrc.txt

Exports all application objects from the MyApp database to MyAppSrc.txt.

EXAMPLE 2

Export-NAVApplicationObject MyAppSrc.txt -DatabaseName MyApp

Exports all application objects from the MyApp database to MyAppSrc.txt.

EXAMPLE 3

Export-NAVApplicationObject MyApp COD1-10.txt -Filter 'Type=Codeunit;Id=1..10'

Exports codeunits 1..10 from the MyApp database to COD1-10.txt

EXAMPLE 4

Export-NAVApplicationObject COD1-10.txt -DatabaseName MyApp -Filter 'Type=Codeunit;Id=1..10'

Exports codeunits 1..10 from the MyApp database to COD1-10.txt

EXAMPLE 5

Export-NAVApplicationObject COD1-10.txt -DatabaseName MyApp -Filter 'Type=Codeunit;Id=1..10' | Import-NAVApplicationObject -DatabaseName MyApp2

Copies codeunits 1..10 from the MyApp database to the MyApp2 database.

EXAMPLE 6

Export-NAVApplicationObject MyAppSrc.txt -DatabaseName MyApp | Split-NAVApplicationObject -Destination MyAppSrc

Exports all application objects from the MyApp database and splits into single-object files in the MyAppSrc folder.

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 from which you want to export.

Type:String
Position:1
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

-ExportToNewSyntax

Export the application object to the syntax supported by the Txt2Al converter.

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

-ExportTxtSkipUnlicensed

Allows the command to skip application objects that are excluded from license, when exporting as txt.

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

-Filter

Specifies the filter that selects the objects to export.

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

-Force

Allows the command to create a file that overwrites an existing file.

Type:SwitchParameter
Position:Named
Default value:False
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

-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 the file to export to.

Type:String
Position:2
Default value:None
Required:True
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

None

You cannot pipe input to this function.

Outputs

System.IO.FileInfo

An object representing the exported file.