Skip to main content

JDEdwardsE1 - Customer sync

JDEdwardsE1 Connector - CustomerUpdate The CustomerUpdate function syncs customer data from JDEdwardsE1 to App4Sales. It retrieves custome...

Updated over a week ago

JDEdwardsE1 Connector - CustomerUpdate

The CustomerUpdate function syncs customer data from JDEdwardsE1 to App4Sales. It retrieves customer information, including addresses and contacts, and processes it in batches. The connector fetches data from two different customer views, likely representing different customer types or hierarchies.

Data Source Configuration

The connector fetches customer data from a JDEdwardsE1 ERP system using POST requests to the /data/view endpoint. The specific views used are determined by the CustomerIdentifier and CustomerIdentifier2 connector settings. The requests are authenticated using a token provided in the settings.

Data Mapping Table (Customer)

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

CustomerCode

CustomerCode

Direct mapping.

CustomerName

CustomerName

The value from the CustomerIdentifier setting is prepended to the customer name (e.g., "[Identifier] Customer Name"). If the customer is marked as not allowed to order, " (Sold To Only)" is appended.

CustomerManager

CustomerManager

Direct mapping.

LanguageCode

LanguageCode

The ERP language code is mapped to an App4Sales language code via the MappedLanguages table.

VatCode

VatNumber

Direct mapping.

CustomerClassification

Derived

Set to "NotAllowedToOrder" if the customer's ParentId is in the list of customers from the first view.

Data Mapping Table (Address)

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

AddressType

Hardcoded

A "Visit" address is created for each customer.

AddressLine1

AddressLine1

Direct mapping.

AddressLine2

AddressLine2

Direct mapping.

AddressLine3

AddressLine3, AddressLine4

Concatenation of AddressLine3 and AddressLine4 with a space in between.

City

City

Direct mapping.

PostCode

PostalCode

Direct mapping.

Country

Country

Direct mapping.

Data Mapping Table (ContactPerson)

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

FullName

ContactName

Direct mapping. Records with a LineNumber greater than 0 are treated as contact persons.

Special Logic & Filters

  • The connector first retrieves a list of customers using the CustomerIdentifier setting. Then, it retrieves a second list using CustomerIdentifier2, and any customer from the second list whose ParentId is present in the first list is marked as "Not allowed to order".

  • Customers with an empty CustomerName or CustomerCode are considered invalid and skipped.

  • Customer data is processed in batches of 100.

  • The system executes BeforeUpdateCustomers and UpdateCustomers scripts, allowing for custom modifications.

Domain Specifics / Extension Section

Customer Core Fields

  • GUID Handling: The system attempts to reuse existing CustomerGuids for inactive customers to preserve history. If a GUID is not found, a new one is generated.

  • Price Lists: If price deduplication is enabled, the connector migrates customers to deduplicated pricelists based on mappings in KeySettings.GenericPriceListMigrations. A default action pricelist can be set via the DefaultActionPriceListCode setting.

  • Payment Conditions: Empty payment condition codes are set to null to prevent foreign key issues.

Addresses

  • The system ensures that each customer has both a "Visit" and a "Delivery" address. If one is missing, it's created by copying the other. If no addresses are provided, a dummy address may be created.

  • Address country codes are normalized using the MappedCountries table and ISO standards.

  • The first "Visit" and "Delivery" addresses are marked as the main address for their respective types if no main address is specified.

Contacts

  • A main contact person is designated for each customer. If not specified, the first contact in the list is chosen.

  • Contact names are parsed to populate First Name, Middle Name, and Last Name fields if they are not provided individually.

Extra Data & Free Fields

  • The connector can enrich customer data with information from an external CSV file (ExtraCustomerData). Fields from the CSV file overwrite existing customer data if the property names match.

  • Custom fields prefixed with FreeField_ in the extra data file are added to the customer's free fields.

  • Item filters can be applied to customers based on columns prefixed with ItemFilter_ in the extra data file, if the CustomerItemFilter setting is enabled.

Discounts & Dashboards

  • Discounts per item class value (DiscountsPerItemCLassValue) are saved for each customer.

  • Customer-specific dashboards are processed from a Base64 encoded string and stored separately.

  • Customer notes are deleted and re-inserted to ensure they are up-to-date.

Related Settings & Prerequisites

  • CustomerIdentifier: The identifier for the primary customer view in JDEdwardsE1.

  • CustomerIdentifier2: The identifier for the secondary customer view in JDEdwardsE1.

  • Token: The authentication token for accessing the JDEdwardsE1 API.

  • EnablePriceDeduplication: Enables the price list migration logic.

  • DefaultActionPriceListCode: Sets a default action pricelist for all customers.

  • CustomerItemFilter: Enables the processing of fixed item filters from extra customer data.

Did this answer your question?