DbFact Connector - Item Update
This document details the process by which item data, including prices, images, and stock information, is synchronized from the DbFact ERP system into the App4Sales platform. The connector retrieves item information via a SOAP web service and transforms it into the App4Sales internal item model.
Data Source Configuration
The connector interacts with the DbFact ERP system primarily through SOAP web services.
Main Item Data: Item information is retrieved by calling the
ArtExportDossiermethod of the DbFact web service. This method returns item data in an XML format.Item Images: Item images are fetched through a separate web service call,
GetArtImage. This service takes an image ID (obtained from the main item data) and returns the image content as a Base64 encoded string.Item Stock: Basic stock levels are included in the main item data. For real-time stock checks, the connector utilizes the
StockExportDossierweb service method.
Data Mapping Table: Items
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
ItemCode | ArtNummer, VolgNummer, Referentie | Derived based on connector settings:
|
InternalItemCode | ArtCode | Direct mapping. |
EanCode | StukNummer | Direct mapping. |
Description | Omschrijving, ExtraTekstTaal1 | If 'Use extra text as description' is enabled, uses |
Description2 | Omschrijving2, ExtraTekstTaal2 | If 'Use extra text as description' is enabled, uses |
Description3 | Omschrijving3, ExtraTekstTaal3 | If 'Use extra text as description' is enabled, uses |
Description4 | Omschrijving4, ExtraTekstTaal4 | If 'Use extra text as description' is enabled, uses |
LastAvailableStock | Stock | Parsed as a decimal, invariant culture. |
CreatedDate | CreatieDat | Parsed as a date with format "yyyyMMdd". |
NextDelivery | VerwachtDat | Parsed as a date with format "yyyyMMdd". If empty or whitespace, set to null. |
VatPercentage | BtwPercentage | Parsed as a decimal. |
PurchasePackageSize | VerkoopsVerpakking, VerkoopsAantal | If 'Use VerkoopsVerpakking as purchase package size' is enabled, uses |
VatIncluded | Hardcoded | Hardcoded to 'E'. |
Currency | Prices.Valuta | If |
Category / ItemClass / FreeField | Groep, Soort, Merk, Kleur, Status, VeldC1-C6, VeldN1-N5 | Used for item classification and custom fields. Specific mapping details depend on configuration. The |
Data Mapping Table: Item Prices
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
SalesPrice (various price lists) | WinkelExcl, WinkelIncl, Dealer, PromoPrijsExcl, PromoPrijsIncl, PromoPrijsDealerExcl, PromoPrijsDealerIncl, PromoPrijsMinVerkExcl, PromoPrijsMinVerkIncl, AanbevolenIncl, BasisExcl, MinimumVerkoopExcl, Prijs1, Prijs2, Prijs3, Prijs4, Prijs5 | The specific price field used is determined by the connector settings |
PromotionPriceValidFrom | PromoPrijsVan | Date indicating the start of a promotion. |
PromotionPriceValidTo | PromoPrijsTot | Date indicating the end of a promotion. |
Special Logic & Filters
Item Code Resolution: The
GetItemCodemethod dynamically determines the item code based on configured settings (UseSerialNumberAsItemCode,UseReferenceAsItemCode).Sales Price Retrieval: The
GetSalesPricemethod allows for flexible price retrieval. It attempts to use the price field specified by thePriceListXIdsettings. If the specified field is not found or is empty, it defaults toWinkelExcl.Free Sort Field: The
GetFreeSortFieldmethod allows mapping a configurable field from the DbFact article to an integer for sorting purposes. It attempts to parse the value as an integer, taking only the part before any decimal separator.Free Fields Generation: The
GetFreeFieldsmethod generates additional free fields for the item, including "Verwachte Levertijd" (Expected Delivery Time) derived fromVerwachtDatand "Extra Tekst" fromExtraTekstTaal1.Image Processing: The
MakePictureInBytesmethod is responsible for making a separate web service call (GetArtImage) to retrieve images for each item, which are then returned as a Base64 string.Stock Retrieval: The
OptA4SGetStockForItemmethod handles the real-time retrieval of stock information using theStockExportDossierweb service.
Domain Specifics (Expanded)
Price Logic
Pricing in the DbFact connector is highly flexible and configurable. Item prices are sourced from the DbFactArticlePrice entity, which offers various price fields (e.g., WinkelExcl, Dealer, PromoPrijsExcl, Prijs1-Prijs5).
The connector uses the PriceList1Id to PriceList4Id settings to determine which specific price field from DbFact maps to an App4Sales sales price. If a configured price list ID does not correspond to an available price field or if the field's value is empty, the system defaults to using the WinkelExcl (Retail Price Excl. VAT) as the sales price.
Image Handling
Images for items are retrieved independently of the main item data. For each item, the connector makes a separate web service call to the GetArtImage method, passing an image ID. The image data is then received as a Base64 encoded string. The connector does not explicitly define any resizing, compression, or maximum image count logic within the observed code.
Stock & Availability
Basic stock information is provided within the primary item data (Stock field). For more dynamic or real-time stock figures, the connector leverages the StockExportDossier web service. The current implementation does not explicitly detail handling for multiple warehouses, reserved stock, or specific rules for zero/negative stock items beyond what is directly provided by the ERP.
Matrix & Attributes
The DbFact connector uses several fields for item classification and attributes:
Brand (Merk): The
Merkfield from DbFact is used to classify the item's brand.Color (Kleur): The
Kleurfield serves as a classification for the item's color.Status: The
Statusfield provides an item's current status.Group (Groep): The
Groepfield categorizes items into groups.Type (Soort): The
Soortfield defines the item's type.Free Fields: Generic free text/numeric fields (
VeldC1-C6,VeldN1-N5) can be used for additional item attributes. The connector also generates "Verwachte Levertijd" (Expected Delivery Time) and "Extra Tekst" as free fields.
The investigation did not reveal specific functionality for handling complex matrix items or product variants where parent-child relationships are defined based on attributes like size and color. The Maat (Size) and Kleur (Color) fields are treated as simple classifications rather than dimensions of a matrix.
Related Settings & Prerequisites
The behavior of the Item Update process is influenced by the following connector settings:
Setting Name | Description |
Environment | Specifies the DbFact environment to connect to. |
Warehouse | Defines the warehouse to retrieve stock information from. |
Dossier | The dossier number or identifier relevant for the DbFact integration. |
Price List 1 Id | Identifier for the first price list to be used for item pricing. This maps to a specific price field in DbFact. |
Price List 2 Id | Identifier for the second price list to be used for item pricing. |
Price List 3 Id | Identifier for the third price list to be used for item pricing. |
Price List 4 Id | Identifier for the fourth price list to be used for item pricing. |
Item Status | Filter items based on their status in DbFact. |
Free Sort Field | A DbFact article field used to define a custom sorting order for items. |
Field C5 Article Exclude | If checked, items where DbFact field C5 is set will be excluded from the item sync. |
Article Batch | Enables or disables batch processing for article updates. |
Use Price Matrix | Indicates whether a price matrix (multi-dimensional pricing) is in use. (Note: Current code analysis did not reveal specific matrix item handling). |
Use Serial Number As Item Code | If checked, the DbFact |
Use Extra Text As Description | If checked, the DbFact |
Use Verkoops Verpakking As Purchase Package Size | If checked, the DbFact |
Use Groep And Soort As Item Filters | If checked, items can be filtered based on their 'Groep' and 'Soort' values. |
Use reference as itemcode (itemsync) | If checked, the DbFact |
Known Limitations
Matrix/Variant Items: The current implementation does not appear to support the sophisticated handling of matrix items or product variants, where distinct child items are generated based on attribute combinations (e.g., Size, Color). The 'Maat' and 'Kleur' fields are treated as simple classifications.
Image Processing: While images are retrieved, the connector does not explicitly implement features like image resizing, compression, or enforcement of a maximum number of images per item.
Multi-Warehouse Stock: The current stock retrieval mechanism primarily focuses on a single warehouse as configured in the settings. There is no explicit support for synchronizing stock levels from multiple distinct warehouses.