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(viaRoutes.GetCustomers).Addresses: Retrieved from
AdresseLivraisonService/rest/GetList(viaRoutes.GetAddresses). These are grouped byCustomerCodein App4Sales.Contact Persons: Retrieved from
ContactTiersService/rest/GetList(viaRoutes.GetContacts). These are grouped byCustomerCodein App4Sales.Payment Conditions: Retrieved from
ModeReglementService/rest/GetList(viaRoutes.GetPaymentConditions).Delivery Methods: Retrieved from
ModeExpeditionService/rest/GetList(viaRoutes.GetDeliveryMethods).
Data Mapping Table
Customer Core Fields
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
CustomerCode |
| Direct mapping from Sage100 Customer entity. |
PaymentConditionCode |
| Mapped from Sage100's Payment Condition ID to a code. |
CustomerName |
| Direct mapping from Sage100 Customer entity. |
| Direct mapping from Sage100 Customer entity. | |
Fax |
| Direct mapping from Sage100 Customer entity. |
Phone |
| Direct mapping from Sage100 Customer entity. |
Website |
| Direct mapping from Sage100 Customer entity. |
VatCode |
| Direct mapping from Sage100 Customer entity. |
LanguageCode |
| Sage100's language string is parsed into an enum. Defaults to 'NL' if parsing fails. |
VatLiable |
| Set to |
UsesPriceField |
| Maps to |
Addresses
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
AddressLine1 |
| Initially mapped from the customer's primary address. Additional addresses are mapped from the separate Address entity. |
AddressLine2 |
| Initially mapped from the customer's primary address. Additional addresses are mapped from the separate Address entity. |
PostCode |
| Initially mapped from the customer's primary address. Additional addresses are mapped from the separate Address entity. |
City |
| Initially mapped from the customer's primary address. Additional addresses are mapped from the separate Address entity. |
State |
| 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 |
| Initially mapped from the customer's primary address. Additional addresses are mapped from the separate Address entity. |
| Only for additional addresses. | |
Fax |
| Only for additional addresses. |
Phone |
| Only for additional addresses. |
IsMainAddress |
| Set to |
AddressType | N/A | Defaulted to |
Contacts
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
| Direct mapping from Sage100 ContactPerson entity. | |
FirstName |
| Direct mapping from Sage100 ContactPerson entity. |
LastName |
| Direct mapping from Sage100 ContactPerson entity. |
Function |
| Direct mapping from Sage100 ContactPerson entity. |
MobileNumber |
| Direct mapping from Sage100 ContactPerson entity. |
Phonenumber |
| 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 typeCustomerType.Customerfrom Sage100 are processed. Other entities are skipped.Language Code Handling: The
Languefield from Sage100 is parsed into an App4Sales language code. If parsing fails, it defaults to 'NL' (Dutch).VAT Liability: The
VatLiablefield in App4Sales is set totrueif the Sage100IdCategorieComptablecorresponds toVatLiabilityOptions.SalesNational.Price Field Usage: The
UsesPriceFieldin App4Sales is populated from Sage100'sIdCategorieTarifaire. 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 withAddressType.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
Regiondata 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
CustomerUpdatemethod or its immediate helper methods (ConvertToModel). These aspects might be handled by theCustomerUpdateHandleror other parts of the connector that were not part of this analysis scope.