New-NAVTableConnection

Registers a connection to an external database table so the table can be used by the Business Central application.

Syntax

New-NAVTableConnection
   [-ServerInstance] <String>
   -ConnectionType <TableConnectionType>
   -ConnectionId <String>
   [-DatabaseServer <String>]
   [-DatabaseName <String>]
   [-DatabaseCredentials <PSCredential>]
   [-ConnectionTimeout <Int32>]
   [-Force]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-NAVTableConnection
   [-ServerInstance] <String>
   -ConnectionType <TableConnectionType>
   -ConnectionId <String>
   [-ConnectionString <String>]
   [-Force]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-NAVTableConnection
   [-ApplicationDatabaseServer <String>]
   -ApplicationDatabaseName <String>
   [-ApplicationDatabaseCredentials <PSCredential>]
   -ConnectionType <TableConnectionType>
   -ConnectionId <String>
   [-DatabaseServer <String>]
   [-DatabaseName <String>]
   [-DatabaseCredentials <PSCredential>]
   [-ConnectionTimeout <Int32>]
   [-Force]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-NAVTableConnection
   [-ApplicationDatabaseServer <String>]
   -ApplicationDatabaseName <String>
   [-ApplicationDatabaseCredentials <PSCredential>]
   -ConnectionType <TableConnectionType>
   -ConnectionId <String>
   [-ConnectionString <String>]
   [-Force]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Use the New-NAVTableConnection cmdlet to create a new set of connection settings for the application/service.

The connection settings are stored along with the application and can be used by all Business Central Server instances that are connected to the specified application.

Code in your application can then use tables at the specified destination. You can connect to a Business Central database by specifying the Business Central Server instance or the application database.

Examples

EXAMPLE 1

New-NAVTableConnection -ServerInstance BC ConnectionType CRM -ConnectionId myCRM

This example creates a connection to a Dynamics 365 for Sales table.

Parameters

-ApplicationDatabaseCredentials

Specifies the user name and password of an SQL Server Authentication login account that provides access to the Business Central application database in SQL Server. You use this parameter to access the database by using SQL Server Authentication. If you want to use Windows Authentication, then you can omit this parameter The login account must be a member of the db_owner role on the database.

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

-ApplicationDatabaseName

Specifies the name of the Business Central database that contains the application tables in a multitenant deployment.

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

-ApplicationDatabaseServer

Specifies the name of the computer on which the SQL Server instance for the Business Central database that contains the application tables is installed in the multitenant deployment.

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

-Confirm

Prompts you for confirmation before executing the command.

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

-ConnectionId

Specifies the name of the table connection.

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

-ConnectionString

Specifies the connection string for the table connection

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

-ConnectionTimeout

Specifies the time (in seconds) to wait while trying to establish a connection before terminating the attempt and generating an error.

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

-ConnectionType

Specifies the type of table connection. In the current Business Central version, you can specify two types of connection: CRM or ExternalSQL.

Type:TableConnectionType
Accepted values:CRM, ExternalSQL, Exchange, MicrosoftGraph, Query
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DatabaseCredentials

Specifies the user name and password for an SQL Server Authentication login account that provides access to the database or, in a multitenant deployment, the tenant database in SQL Server. You use this parameter to access the database by using SQL Server Authentication. If you want to use Windows Authentication, then you can omit this parameter. The login account must be a member of the db_owner role on the database.

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

-DatabaseName

Specifies the name of the Business Central database, such as 'Demo Database NAV ', that you want to establish the table connection to.

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

-DatabaseServer

Specifies the name of the computer on which the SQL Server instance for the Business Central database is installed.

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

-Force

Forces the command to run without asking for user confirmation.

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

-ServerInstance

Specifies the name of a Business Central Server instance, for example, BC or myinstance. You can specify either the full name of an instance, such as MicrosoftDynamicsNavServer$myinstance or the short name such as myinstance.

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

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

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