Compile-NAVApplicationObject

Compiles Business Central application objects in a database.

Syntax

Compile-NAVApplicationObject
       [-DatabaseName] <String>
       [-DatabaseServer <String>]
       [-LogPath <String>]
       [-Filter <String>]
       [-Recompile]
       [-AsJob]
       [-SynchronizeSchemaChanges <String>]
       [-NavServerName <String>]
       [-NavServerInstance <String>]
       [-NavServerManagementPort <Int16>]
       [-GenerateSymbolReference]
       [<CommonParameters>]
Compile-NAVApplicationObject
       [-DatabaseName] <String>
       [-DatabaseServer <String>]
       [-LogPath <String>]
       [-Filter <String>]
       [-Recompile]
       [-AsJob]
       [-SynchronizeSchemaChanges <String>]
       -Username <String>
       -Password <String>
       [-NavServerName <String>]
       [-NavServerInstance <String>]
       [-NavServerManagementPort <Int16>]
       [-GenerateSymbolReference]
       [<CommonParameters>]

Description

The Compile-NAVApplicationObject function compiles application objects in the specified database. A filter can be specified to select the application objects to be compiled. Unless the Recompile switch is used only uncompiled objects are compiled.

Examples

EXAMPLE 1

Compile-NAVApplicationObject MyApp

Compiles all uncompiled application objects in the MyApp database.

EXAMPLE 2

Compile-NAVApplicationObject MyApp -Filter 'Type=Codeunit' -Recompile

Compiles all codeunits in the MyApp database.

EXAMPLE 3

'Page','Codeunit','Table','XMLport','Report','Query' | % { Compile-NAVApplicationObject -DatabaseName MyApp -Filter "Type=$_" -AsJob } | Receive-Job -Wait

Compiles all uncompiled Pages, Codeunits, Tables, XMLports, Reports and Queries in the MyApp database in parallel and wait until it is done. Note that some objects may remain uncompiled due to race conditions. Those remaining objects can be compiled in a seperate command.

Parameters

-AsJob

Compiles in the background returning an object that represents the background job.

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

-DatabaseName

Specifies the name of the Business Central database.

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 Business Central database 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

-Filter

Specifies the filter that selects the objects to compile.

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

-GenerateSymbolReference

Specifies that symbols should be generated for application objects as part of compilation. Generating symbols is used when developing by using both C/SIDE and AL. It ensures that changes to objects in C/SIDE are reflected in the symbol download of the the AL Language extension in Visual Studio Code. For more information, see Running C/SIDE and AL Side-by-Side.

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

-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

-Recompile

Compiles objects that are already compiled.

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

-SynchronizeSchemaChanges

Specifies the schema synchronization behaviour. The default value is 'Yes'.

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

Inputs

None

You cannot pipe input to this function.

Outputs

None