Zum Hauptinhalt springen

DynamicsOpts

DynamicsOpts = object

Properties​

connection​

connection: object

Connection details for the ERP system.

clientId​

clientId: string

tenantId​

tenantId: string

clientSecret​

clientSecret: string

environment?​

optional environment: string

BC environment name (e.g. "Production"). Not required when baseUrl is set.

baseUrl?​

optional baseUrl: string

Custom base URL for on-premise BC deployments. When set, replaces the standard cloud base URL (https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environment}).

Example​
"https://your-bc-server:port/instance"

timeout?​

optional timeout: number

Timeout in milliseconds for HTTP requests to the BC API.

Default​
5000

ignoreSelfSignedCertificate?​

optional ignoreSelfSignedCertificate: boolean

If true, self-signed certificates are accepted. Useful for on-premise BC deployments.

Default​
false

getCompanyIdForRecipient()?​

optional getCompanyIdForRecipient: (recipient) => string

Optional function to get the companyId for a given recipient. If not provided, the companyIdFieldName has to be provided.

Parameters​

recipient​

string

Returns​

string


getCompanyUUIDForRecipient()?​

optional getCompanyUUIDForRecipient: (recipient) => string

Function to get the company UUID (GUID) for a given recipient. Required when posting invoices via the BC standard API v2.0.

Parameters​

recipient​

string

Returns​

string


companyIdFieldName?​

optional companyIdFieldName: string

Optional field name in the recipient file that contains the companyId. If not provided, the getCompanyIdForRecipient function has to be provided.


bookingConfiguration​

bookingConfiguration: object

docFileToBookingMappingFunction()?​

optional docFileToBookingMappingFunction: (docFile, defaultMappingFunction) => BreezeDocumentBody

Parameters​
docFile​

ptpInvoice

defaultMappingFunction​

(docFile) => BreezeDocumentBody

Returns​

BreezeDocumentBody

positionToLineMappingFunction()?​

optional positionToLineMappingFunction: (pos, defaultMappingFunction) => BreezeDocumentBodyLine

Parameters​
pos​

InvoiceItem

defaultMappingFunction​

(pos) => BreezeDocumentBodyLine

Returns​

BreezeDocumentBodyLine

targetTemplate​

targetTemplate: string

The Breeze target template to use when creating a document.

processId​

processId: string

The Breeze process ID to use when creating a document.

dimensionMapping?​

optional dimensionMapping: object

Maps invoice line item fields to BC dimension codes. Dimension codes are customer-specific BC configuration.

Index Signature​

[invoiceField: string]: string

Example​
{ itemCostUnit: "ABTEILUNG", itemCostCenter: "KOSTENSTELLE" }
dimensionMapping.itemCostUnit?​

optional itemCostUnit: string

dimensionMapping.itemCostCenter?​

optional itemCostCenter: string

findPostedInvoice()?​

optional findPostedInvoice: (options) => { erpInvoiceNumber: string; } | null

Optional function to look up a posted purchase invoice. When provided, getDocumentStatus will call this to detect already-posted documents. Return the posting number (the permanent BC invoice number) or null if not found.

Parameters​
options​
companyId​

string

docFile​

ptpInvoice

connector​

DynamicsBcConnector

Returns​

{ erpInvoiceNumber: string; } | null

prePost()?​

optional prePost: (options) => void

Optional function called immediately before a purchase document is posted in BC. Use this to set custom fields or perform any required preparation on the purchase document.

Parameters​
options​
companyId​

string

companyUuid​

string

purchaseDocumentId​

string

docFile​

ptpInvoice

connector​

DynamicsBcConnector

Returns​

void

postPost()?​

optional postPost: (options) => void

Optional function called after a purchase document has been posted in BC and erpInvoiceNumber has been updated to the posting number.

Parameters​
options​
companyId​

string

companyUuid​

string

docFile​

ptpInvoice

connector​

DynamicsBcConnector

Returns​

void


masterDataMapping​

masterDataMapping: MasterDataMapping

Master data mapping configuration. Use the spread pattern to extend or override individual entity mappings while keeping the defaults for the rest.


masterDataConfiguration​

masterDataConfiguration: FetchConfiguration & object

Type Declaration​

tasks​

tasks: object[]


orderDataConfiguration​

orderDataConfiguration: FetchConfiguration & object

Type Declaration​

sinceOrderDate?​

optional sinceOrderDate: Date | string

Optional parameter to only orders since a specific date.


getPaymentRunList()?​

optional getPaymentRunList: (options) => Record<string, unknown>[]

Optional function to fetch the payment run list for a given recipient. When not provided, defaults to fetching vendor ledger entries.

Parameters​

options​
recipient​

string

companyId​

string

connector​

DynamicsBcConnector

Returns​

Record<string, unknown>[]