Skip to main content

Baan - Customer sync

Baan Connector - Customer Update This document describes the process for synchronizing customer data from a Baan ERP system to the App4Sa...

Updated over a week ago

Baan Connector - Customer Update

This document describes the process for synchronizing customer data from a Baan ERP system to the App4Sales platform. The process retrieves customer core data, addresses, and contact persons, then applies various business rules and transformations before storing the data in App4Sales. The data is fetched from a Baan web service.

Data Source Configuration

The connector retrieves customer data by calling the A4SListCustomers method on the Baan web service. The service endpoint is configured in the administration settings. Authentication is done using a username also configured in the settings. The service returns an XML structure containing a list of customers and their details.

Customer Core Fields

App4Sales Field

Source Field (XML Caption)

Logic/Notes

CustomerGuid

customers.customerGUID

The GUID is taken from the source if available. If not, the system attempts to find an existing GUID based on the CustomerCode. If no existing GUID is found, a new one is generated. Inactive customers can be reactivated, reusing their existing GUID.

CustomerCode

customers.customerCode

The value is trimmed. This field is mandatory.

CustomerName

customers.customerName

Direct mapping. This field is mandatory.

LanguageCode

customers.languageCode

The ERP language code is mapped to an App4Sales language code.

Discount

customers.discount

Parsed as a decimal. Defaults to 0 if the source value is missing or empty.

CustomerManager

customers.customerManager

Direct mapping.

Sysmodified

customers.sysmodified or customers.lastModified

Uses customers.sysmodified if available, otherwise falls back to customers.lastModified. If neither is present, the current date and time is used.

VatCode

customers.VATCode

Direct mapping. This field is cleared if the administration is a USA-based administration.

VatLiable

customers.isVATLiable

Parsed as a boolean. This field is set to false if the administration is a USA-based administration.

PaymentConditionCode

Not in source XML

The generic handler sets this to null if it's an empty string to prevent foreign key issues. It is not explicitly mapped in the Baan connector.

ActionPriceList

Not in source XML

The generic handler can set a default action price list based on the DefaultActionPriceListCode connector setting. It is not explicitly mapped in the Baan connector.

Addresses

The connector creates two address records for each customer: one for the delivery address and one for the visit address.

App4Sales Field

Source Field (XML Caption)

Logic/Notes

AddressType

(hardcoded)

'del' for the delivery address, 'vis' for the visit address. The generic handler ensures both types exist, potentially by duplicating an existing address.

AddressLine1

customers.deliveryAddress1, customers.visitAddress1

Mapped from the respective source fields. The generic handler may parse this into structured street, number, and addition fields.

PostCode

customers.deliveryPostCode, customers.visitPostCode

Mapped from the respective source fields.

City

customers.deliveryCity, customers.visitCity

Mapped from the respective source fields.

Country

customers.languageCode

The customer's language code is used as the country. The generic handler attempts to derive a standardized ISO2 code from this.

Phone

customers.contactPhone

The same phone number is used for both addresses.

Email

(hardcoded)

Hardcoded to an empty string in the Baan connector. The generic handler might fill it with the customer's main email if the address is a main address.

Fax

(hardcoded)

Hardcoded to an empty string.

IsMainAddress

(Derived)

The generic handler will set one visit address and one delivery address as the main address if none are marked as such.

Contacts

A single contact person is created for each customer based on the available contact information.

App4Sales Field

Source Field (XML Caption)

Logic/Notes

FullName

customers.contactFullName

Direct mapping. The generic handler may split this into first name and last name.

IsMainContactPerson

(Derived)

The generic handler will mark the first contact person as the main contact if no main contact is specified.

Dashboards, Notes & Other Artifacts

The connector also handles related customer data like dashboards and notes.

App4Sales Field

Source Field (XML Caption)

Logic/Notes

CustomerDashboard

customers.customerDashboard

The Base64 encoded dashboard data is decoded and saved separately.

CustomerNote

Not in source XML

The generic handler has logic to process CustomerNote, but it is not mapped in the Baan connector. If a note were provided, it would delete old "BackOffice" notes and insert the new one.

Special Logic & Filters

  • Data Fixing: The connector has a "fixing data" step that provides default values for several fields if they are missing from the source XML. For example, customers.discount defaults to "0".

  • GUID Resolution: The connector prioritizes the GUID from the source XML, then attempts to find one via the App4Sales portal, and finally generates a new one. This ensures consistency.

  • Batch Processing: The `CustomerUpdateHandler` processes customers in batches of 100 to manage memory and performance.

  • Scripting Hooks: The update process supports `BeforeUpdateCustomers` and `UpdateCustomers` scripts, allowing for custom logic to be injected.

Related Settings & Prerequisites

  • DefaultActionPriceListCode: A connector setting that specifies a default action price list for all customers.

  • EnablePriceDeduplication: A setting to enable price list migration to deduplicated versions.

Did this answer your question?