DynamicsOpts
DynamicsOpts =
object
Properties
connection
connection:
object
Connection details for the ERP system.
clientId
clientId:
string
tenantId
tenantId:
string
clientSecret
clientSecret:
string
environment?
optionalenvironment:string
BC environment name (e.g. "Production"). Not required when baseUrl is set.
baseUrl?
optionalbaseUrl: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?
optionaltimeout:number
Timeout in milliseconds for HTTP requests to the BC API.
Default
5000
ignoreSelfSignedCertificate?
optionalignoreSelfSignedCertificate:boolean
If true, self-signed certificates are accepted. Useful for on-premise BC deployments.
Default
false
getCompanyIdForRecipient()?
optionalgetCompanyIdForRecipient: (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()?
optionalgetCompanyUUIDForRecipient: (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?
optionalcompanyIdFieldName: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()?
optionaldocFileToBookingMappingFunction: (docFile,defaultMappingFunction) =>BreezeDocumentBody
Parameters
docFile
defaultMappingFunction
(docFile) => BreezeDocumentBody
Returns
BreezeDocumentBody
positionToLineMappingFunction()?
optionalpositionToLineMappingFunction: (pos,defaultMappingFunction) =>BreezeDocumentBodyLine
Parameters
pos
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?
optionaldimensionMapping: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?
optionalitemCostUnit:string
dimensionMapping.itemCostCenter?
optionalitemCostCenter:string
findPostedInvoice()?
optionalfindPostedInvoice: (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
connector
DynamicsBcConnector
Returns
{ erpInvoiceNumber: string; } | null
prePost()?
optionalprePost: (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
connector
DynamicsBcConnector
Returns
void
postPost()?
optionalpostPost: (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
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?
optionalsinceOrderDate:Date|string
Optional parameter to only orders since a specific date.
getPaymentRunList()?
optionalgetPaymentRunList: (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>[]