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
IndicatorFieldNameToSyncCustomerssetting.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 |
VatCode | VatNumber | Direct mapping from MBC Customer VAT Number. |
Phone | PhoneNumber | Direct mapping from MBC Customer Phone Number. |
Fax, Email | If | |
PaymentConditionCode | PaymentTermsCode, PaymentMethodCode | If |
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 |
Website | Website | Direct mapping from MBC Customer Website. |
CustomerNote | Comment | If |
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. |