Skip to main content

Sage100 - Customer sync

Sage100 Connector - Customer Update The Customer Update function synchronizes customer-related data from Sage100 to the App4Sales pl...

Updated over a week ago

Sage100 Connector - Customer Update

The Customer Update function synchronizes customer-related data from Sage100 to the App4Sales platform. This process involves retrieving customer core data, addresses, contact persons, payment conditions, and delivery methods from Sage100. It filters out inactive customers and non-customer entities, then transforms the retrieved data into App4Sales' internal customer, address, and contact person models before updating the App4Sales database.

Data Source Configuration

The connector pulls customer data, addresses, and contact persons from the Sage100 API using HTTP GET requests.

  • Customers: Retrieved from TiersService/rest/GetListClient (via Routes.GetCustomers).

  • Addresses: Retrieved from AdresseLivraisonService/rest/GetList (via Routes.GetAddresses). These are grouped by CustomerCode in App4Sales.

  • Contact Persons: Retrieved from ContactTiersService/rest/GetList (via Routes.GetContacts). These are grouped by CustomerCode in App4Sales.

  • Payment Conditions: Retrieved from ModeReglementService/rest/GetList (via Routes.GetPaymentConditions).

  • Delivery Methods: Retrieved from ModeExpeditionService/rest/GetList (via Routes.GetDeliveryMethods).

Data Mapping Table

Customer Core Fields

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

CustomerCode

NumeroTiers

Direct mapping from Sage100 Customer entity.

PaymentConditionCode

PaymentCondition (int) from Customer entity; Id from PaymentCondition entity

Mapped from Sage100's Payment Condition ID to a code.

CustomerName

Intitule

Direct mapping from Sage100 Customer entity.

Email

Email

Direct mapping from Sage100 Customer entity.

Fax

Fax

Direct mapping from Sage100 Customer entity.

Phone

Telephone

Direct mapping from Sage100 Customer entity.

Website

SiteWeb

Direct mapping from Sage100 Customer entity.

VatCode

NumeroTva

Direct mapping from Sage100 Customer entity.

LanguageCode

Langue

Sage100's language string is parsed into an enum. Defaults to 'NL' if parsing fails.

VatLiable

IdCategorieComptable

Set to true if IdCategorieComptable is VatLiabilityOptions.SalesNational.

UsesPriceField

IdCategorieTarifaire

Maps to IdCategorieTarifaire, defaulting to -1 if null.

Addresses

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

AddressLine1

Addresse (from Customer entity); Addresse (from Address entity)

Initially mapped from the customer's primary address. Additional addresses are mapped from the separate Address entity.

AddressLine2

Complement (from Customer entity); Complement (from Address entity)

Initially mapped from the customer's primary address. Additional addresses are mapped from the separate Address entity.

PostCode

CodePostal (from Customer entity); CodePostal (from Address entity)

Initially mapped from the customer's primary address. Additional addresses are mapped from the separate Address entity.

City

Ville (from Customer entity); Ville (from Address entity)

Initially mapped from the customer's primary address. Additional addresses are mapped from the separate Address entity.

State

Region (from Customer entity); Region (from Address entity)

Initially mapped from the customer's primary address. Additional addresses are mapped from the separate Address entity. Note: Region from Customer entity is not always used in Sage100.

Country

Pays (from Customer entity); Pays (from Address entity)

Initially mapped from the customer's primary address. Additional addresses are mapped from the separate Address entity.

Email

Email (from Address entity)

Only for additional addresses.

Fax

Fax (from Address entity)

Only for additional addresses.

Phone

Phone (from Address entity)

Only for additional addresses.

IsMainAddress

EstPrincipale (from Address entity)

Set to true if EstPrincipale is Main.Yes. Only for additional addresses.

AddressType

N/A

Defaulted to Visit for the address derived from the main customer entity. Defaulted to Delivery for addresses derived from the separate Address entity.

Contacts

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

Email

Email

Direct mapping from Sage100 ContactPerson entity.

FirstName

PreNom

Direct mapping from Sage100 ContactPerson entity.

LastName

Nom

Direct mapping from Sage100 ContactPerson entity.

Function

Function

Direct mapping from Sage100 ContactPerson entity.

MobileNumber

GSM

Direct mapping from Sage100 ContactPerson entity.

Phonenumber

Telephone

Direct mapping from Sage100 ContactPerson entity.

Extra Data & Free Fields

The connector processes custom dynamic fields configured in App4Sales. If the Sage100 Customer entity contains FreeFields (from InfosLibres) that match the XML element names of the dynamic fields (after replacing underscores with spaces), their values are extracted. These extracted values are then serialized into an XML string and stored in the DynamicFreeFields property of the App4Sales Customer model.

Only free fields with a non-empty Value are included.

Special Logic & Filters

  • Customer Filtering: Only active customers (Active == Active.Yes) and entities of type CustomerType.Customer from Sage100 are processed. Other entities are skipped.

  • Language Code Handling: The Langue field from Sage100 is parsed into an App4Sales language code. If parsing fails, it defaults to 'NL' (Dutch).

  • VAT Liability: The VatLiable field in App4Sales is set to true if the Sage100 IdCategorieComptable corresponds to VatLiabilityOptions.SalesNational.

  • Price Field Usage: The UsesPriceField in App4Sales is populated from Sage100's IdCategorieTarifaire. If this value is not provided by Sage100, it defaults to -1.

  • Address Handling: The primary address information from the main customer entity in Sage100 is used to create an App4Sales address with AddressType.Visit. Any additional addresses retrieved separately from Sage100 are added as App4Sales addresses with AddressType.Delivery.

Related Settings & Prerequisites

  • Custom Dynamic Fields: The behavior of Free Fields mapping is dependent on the configuration of Custom Extra Fields in App4Sales. These need to be set up to match the XML element names of Sage100's free fields for them to be processed.

Known Limitations

  • The connector assumes that Region data from the Sage100 Customer entity might not always be used or populated, as indicated by comments in the code.

  • Customer GUIDs are not explicitly handled in the provided code snippets for `CustomerUpdate` process, implying that GUID management might be handled at a higher level (e.g., `CustomerUpdateHandler`) or rely on other identifiers for updates/reactivation. Further investigation would be needed to document `CustomerGuid` retrieval and reactivation rules comprehensively.

  • Specific logic for customer dashboards, price list links, fixed item filters, and customer-specific item class discounts were not directly identifiable within the CustomerUpdate method or its immediate helper methods (ConvertToModel). These aspects might be handled by the CustomerUpdateHandler or other parts of the connector that were not part of this analysis scope.

Did this answer your question?