Share via


New-NAVCrmTable

Creates Business Central table objects that are based on Dynamics 365 for Sales entities. The table objects are saved as .txt files.

Syntax

NormalParameters

New-NAVCrmTable
    [-CRMServer] <Uri>
    [-Credential] <PSCredential>
    [-EntityLogicalName] <String[]>
    [-ObjectId] <Int32[]>
    [-AuthenticationType <CrmAuthentication>]
    [-Name <String[]>]
    [-RedirectUri <String>]
    [-Domain <String>]
    [-HomeRealmUri <String>]
    [-ClientId <String>]
    [-DeltaPath <String>]
    [-OutputPath <String>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

PassThroughConnectionString

New-NAVCrmTable
    [-EntityLogicalName] <String[]>
    [-ObjectId] <Int32[]>
    -ConnectionString <String>
    [-Name <String[]>]
    [-OutputPath <String>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use this cmdlet when integrating Business Central with Dynamics 365 for Sales. This cmdlet creates one or more table objects in Business Central that correspond to entities in Dynamics 365 for Sales. The created tables are eventually used to map fields in Dynamics 365 for Sales with fields in business data tables of Business Central. Each table object is saved as a .txt file on your computer or network and can be imported into a Business Central database. The tables have the following characteristics:

  • The TableType property is set to CRM.
  • Contains field definitions for all fields in a Dynamics 365 for Sales entity that have a data type that is supported by Business Central. References to other Dynamics 365 for Sales entities will only be included if the entity is included in the command line.

Only external tables that are based on by actual Dynamics 365 for Sales entities are supported. In Dynamics 365 for Sales, the entities must support one or more of the following actions:

Create, Update, Delete, Retrieve, RetrieveMultiple, Associate (one-to-many relationship only), Disassociate (one-to-many relationship only), Execute (only for setting state)

Examples

EXAMPLE 1

New-NavCrmTable -CRMServer https://myserver.crm.dynamics.com -Credential (Get-Credential -UserName user@myserver.onmicrosoft.com -Message
"Enter Password") -EntityLogicalName account -Name "CRM Account" -ObjectId 50500 -OutputPath c:\CrmObjects

   FileName    : c:\CrmObjects\TAB50500.TXT
   ObjectType  : Table
   Id          : 50500
   VersionList :
   Date        :
   Time        :
   Modified    : False

This example creates a single Business Central table object based on the account entity in Dynamics 365 for Sales. The created table has the ID 50500 and name CRM Account.

EXAMPLE 2

New-NavCrmTable -CRMServer https://myserver.crm.dynamics.com -Credential (Get-Credential -UserName user@myserver.onmicrosoft.com -Message
"Enter Password") -Entity account,contact -Name "CRM Account","CRM Contact" -ObjectId 50500,50501 -OutputPath c:\CrmObjects

  FileName    : C:\CrmObjects\TAB50500.TXT
  ObjectType  : Table
  Id          : 50500
  VersionList :
  Date        :
  Time        :
  Modified    : False
  FileName    : C:\CrmObjects\TAB50501.TXT
  ObjectType  : Table
  Id          : 50501
  VersionList :
  Date        :
  Time        :
  Modified    : False

This example creates two Business Central table objects based on the account and contact entities in Dynamics 365 for Sales.

EXAMPLE 3

New-NavCrmTable -CRMServer https://myserver.local.com/myOrg -Credential (Get-Credential -UserName myserver\UserName -Message
"Enter Password") -AuthenticationType=AD -Entity account,contact -Name "CRM Account","CRM Contact" -ObjectId 50500,50501 -OutputPath c:\CrmObjects

This example creates two Business Central table objects based on the account and contact entities in an on-premise Dynamics 365 for Sales installation that uses Microsoft Entra authentication.

EXAMPLE 4

New-NavCrmTable -CRMServer . -Credential (Get-Credential -UserName "." -Password ".")
-ConnectionString "Url=http://myserver.net/org;UserName=myServer\MyUser;Password=myPassword;AuthType=AD" -Entity account,contact
-Name "CRM Account","CRM Contact" -ObjectId 50500,50501 -OutputPath c:\CrmObjects

This example creates two Business Central table objects based on the account and contact entities in Dynamics 365 for Sales using a specified custom connection string.

Parameters

-AuthenticationType

Specifies the authentication type to connect to Dynamics 365 for Sales instance.

AD and IFD (AD FS enabled) are permitted for Dynamics 365 (CRM) on-premises instances only.

OAuth is permitted for Dynamics 365 (CRM) online and on-premises instances.

Office365 is permitted for Dynamics 365 (CRM) online instances only.

The AuthenticationType parameter is optional. For a list of valid values, see https://aka.ms/dynamicscrmauthenticationtypeenumeration. The default value is Office365, which is the required authentication type for CRM Online.

Possible values: AD, IFD, Office365, OAuth

Parameter properties

Type:CrmAuthentication
Default value:Office365
Accepted values:AD, IFD, Office365, OAuth
Supports wildcards:False
DontShow:False

Parameter sets

NormalParameters
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ClientId

Specifies the Client ID (or Application ID) that was assigned to the Business Central application when it was registered in Microsoft Entra ID or Active Directory Federation Services (AD FS). This parameter is only applicable when the -AuthenticationType parameter is set to OAuth.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NormalParameters
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ConnectionString

Specifies a passthrough connection string that will be used to connect to the Dynamics 365 for Sales instance.

For information about how to create a valid connection string, see https://go.microsoft.com/fwlink/?linkid=848464.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PassThroughConnectionString
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Credential

Specifies a user name and password for accessing Microsoft Dynamics 365 for Sales.

Parameter properties

Type:PSCredential
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NormalParameters
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CRMServer

Specifies the URL of the Dynamics 365 for Sales server to connect to. The Dynamics 365 for Sales server provides access to the entity that you want to create as a table in Business Central. The URL specifies the URI scheme, such as HTTPS or HTTP, and the fully qualified domain name (FQDN) that identifies the Dynamics 365 for Sales organization and the computer where the Dynamics 365 for Sales server is installed. For connecting to Dynamics 365 for Sales Online, the format is typically scheme://organizationname.domainname, such as https://myorganization.crm.dynamics.com, where https is the scheme, myorganization is the organization and crm.dynamics.com is the domain.

Parameter properties

Type:Uri
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NormalParameters
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DeltaPath

Specifies the path for the existing NAV CRM objects, to maintain the existing ID's on the current fields. If object with similar ID is found, we will try to field name match the id's. If no match new ID's will be created for the fields.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NormalParameters
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Domain

Specifies the domain that will verify user credentials.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NormalParameters
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EntityLogicalName

Specifies the logical names of the Dynamics 365 for Sales entities for which to create a Business Central table. This parameter is a comma-separated list. So when you are creating tables for multiple entities, separate each entity logical name with a comma. Each entity logical name must have a corresponding value in the ObjectID parameter based on its position is the list.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Specifies that existing files of the same name in the OutputPath folder are to be overwritten. Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HomeRealmUri

Specifies the Home Realm Uri. This parameter is only applicable when the -AuthenticationType parameter is set to OAuth.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NormalParameters
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the names of the new tables to be created. This parameter is a comma-separated list. So when creating multiple tables, separate each table name by a comma. Each individual name must have a corresponding item in the ObjectID and the EntityLogicalName parameters, based on its position in the list.

The Name parameter is optional, but if you use it, you must specify the names of all new tables, not just one. If you do not specify names, then the tables get the entity logical names as specified by the EntityLogicalName parameter.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ObjectId

Specifies the IDs of the table objects to be created. This parameter is a comma-separated list. So when you are creating multiple table objects, separate each ID with a comma. Each ID must have a corresponding value in the EntityLogicalName parameter, and optionally in the Name parameter, based on its position is the list.

Parameter properties

Type:

Int32[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OutputPath

Specifies the folder path to where the generated .txt files for tables will be saved, such as "c:\CRMObjects". If the folder path does not already exist, it will be created.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RedirectUri

Specifies the Redirect URI that was assigned to the Business Central application when it was registered in Microsoft Entra ID or Active Directory Federation Services (AD FS). This parameter is only applicable when the -AuthenticationType parameter is set to OAuth.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NormalParameters
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.