Skip to main content

MicrosoftBusinessCentral - Customer sync

MicrosoftBusinessCentral Connector - Customer Update This document describes the Customer Update pipeline for the Microsoft Business Cent...

Updated over a week ago

MicrosoftBusinessCentral Connector - Customer Update

This document describes the Customer Update pipeline for the Microsoft Business Central connector. This process synchronizes customer-related data from Microsoft Business Central (MBC) into the App4Sales platform, ensuring that customer, address, contact person, and discount information is consistent and up-to-date. The update mechanism handles initial data retrieval from MBC, transforms it into the App4Sales internal data structure, and then applies various business logic rules before persisting the data.

Data Source Configuration

Customer-related data is retrieved from Microsoft Business Central via its API. The following entities are queried:

  • MBCCustomer: Core customer records are fetched, potentially filtered by the IndicatorFieldNameToSyncCustomers setting.

  • MBCAddress: All addresses associated with customers are retrieved.

  • MBCContact: Contact persons linked to customers are fetched. This includes both individual (Person) and company contacts, and their business relations to customers are established.

  • MBCSalesPriceList: Price list headers are retrieved to determine the appropriate price list for each customer.

  • MBCSalesLineDiscount: Legacy sales line discounts are retrieved, used for calculating customer-specific discounts.

Customer Core Fields

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

CustomerCode

CustomerCode

Direct mapping from MBC Customer Code.

CustomerName

DisplayName

Direct mapping from MBC Customer Display Name.

VatLiable

VatBusPostingGroup, VatNumber, RegionCode

Determined by the IsCustomerVatLiable logic. This takes into account the CountryCodeForAlwaysVATLiableCustomers, MarkCustomersWithoutVATNumberAsVATLiable, VATBusinessPostingGroupCodeForVatLiableCustomers, and VATBusinessPostingGroupCodeForNotVatLiableCustomers connector settings.

VatCode

VatNumber

Direct mapping from MBC Customer VAT Number.

Phone

PhoneNumber

Direct mapping from MBC Customer Phone Number.

Email

Fax, Email

If UseFaxAsCustomerEmailIfNotEmpty setting is true and MBC Fax is not empty, then Fax is used. Otherwise, MBC Email is used.

PaymentConditionCode

PaymentTermsCode, PaymentMethodCode

If UsePaymentTermsAsPaymentConditions setting is true, then MBC Payment Terms Code is used. Otherwise, MBC Payment Method Code is used.

LanguageCode

LanguageCode

Mapped from MBC Language Code using configured language mappings. If no mapping is found, the original MBC Language Code is used.

InternalCode

Id

Direct mapping from MBC Customer Internal ID.

Sysmodified

LastDateModified

Timestamp of last modification in MBC, parsed to DateTime.

Fax

Fax

Direct mapping from MBC Customer Fax.

Currency

CurrencyCode, MBCBaseCurrencyCode

If MBC Customer Currency Code is not empty, it's used. Otherwise, the MBCBaseCurrencyCode connector setting is used.

Website

Website

Direct mapping from MBC Customer Website.

CustomerNote

Comment

If SyncCustomerCommentAsCustomerNote setting is true, MBC Customer Comment is mapped. Otherwise, it's null.

CustomerManager

SalesPersonCode

Direct mapping from MBC Sales Person Code.

UsesPriceField

Derived

The internal App4Sales Price List ID is derived based on the customer's determined currency and price group. The currency determination logic follows a hierarchy: Customer Price List -> Price Group List -> Discount Group Price List -> All Customer Price List -> Customer Invoice Currency -> Default Currency.

Did this answer your question?