Customer Master Data Sync in Practice: Encoding and Organization Mapping from Wangdiantong to Kingdee Cloud
What This Strategy Solves
Pushing customer master data from an e-commerce ERP to a finance ERP looks like a simple "record copy," but if encoding mapping is poorly designed and organization routing is not split, the two sides will disagree within three months—invoices won't issue, receivables won't reconcile. The goal of a customer master data sync strategy is to use a maintainable set of rules to land customer records reliably from source to target, and to follow up automatically on additions and changes. We use the Qeasy data integration platform to host this kind of master data sync, keeping mapping rules centralized so IT does not have to rewrite scripts every time.
Data Flow and Field Mapping
The overall flow is one-way A→B: the e-commerce transaction system is the source, and the finance ERP is the target. The middle layer is an integration strategy on Qeasy, responsible for fetching, cleansing, mapping, and writing.
Key field mapping (source → target):
| Semantic | Source field | Target field | Notes |
|---|---|---|---|
| Customer code | shop_no / customer id | FNumber | Centralized mapping; maintain a "store → code prefix" table in Qeasy |
| Customer name | invoice_title / customer name | FName | Direct assignment; trim spaces and normalize full/half-width |
| Customer group | — | FGroup | Hardcode per business, e.g. "B11" |
| Create org | — | FCreateOrgId | Fixed constant, e.g. "100" |
| Use org | shop_no | FUseOrgId | Route by store id—the field most prone to issues |
| Invoice title | invoice_title | FINVOICETITLE | Reuse when equal to name; mind length limits |
The most critical field is "Use Org"—it must branch by source store id; otherwise the same customer ends up in multiple organizations, producing dirty data.
How to Configure on Qeasy
In Qeasy, a customer sync strategy is typically split into two integration flows: a source-side "query flow" plus a target-side "write flow," stitched together by a strategy.
Configuration points:
- Source query API: Use modified-time-based incremental pull. Bind the start time to
{{LAST_SYNC_TIME}}and the end time to{{CURRENT_TIME}}, sliding the window forward each run to avoid missing records. - Target write API: Use the batch save interface
batchSaveto submit multiple customer records in one call, reducing the number of invocations. - Encoding mapping: Maintain encoding conversion tables in Qeasy's field mapping panel rather than scattering them across if-else branches, so future changes happen in one place.
- Organization routing: Use conditional expressions branching on the source store id, e.g.
case when '{{shop_no}}' in (...) then 'DZ' else 'BZ' end. - Deduplication and idempotency: Use the customer code as the primary key; on duplicates, update instead of insert.
Implementation Steps
A staged rollout is the safe approach:
- Initial full sync: Run a full sync first to load existing customer records into the target at once and verify that encoding mapping and organization routing match expectations.
- Set the incremental start point: After the full sync completes, switch "last sync time" to the current moment and switch to incremental.
- Scheduling frequency: The source side runs every 5 minutes; the target side can run every 8 minutes to spread load.
- Monitoring and alerts: Watch three metrics—records fetched / records written successfully / records failed. If failures stay non-zero for two consecutive cycles, intervene.
- Exception replay: Pull failed batches out, replay manually or after fixing rules; do not pollute the main schedule.
Pitfalls from the Field
- Incomplete organization routing conditions: The most common pitfall. Initially only the main store ids are covered; new stores fall into a default organization, making cleanup painful. The safe approach is to list every store id explicitly and raise an error for unknown ones rather than defaulting.
- Encoding mapping scattered across scripts: When the customer encoding rule changes, you must hunt through scripts. A common pattern on Qeasy is to extract the mapping table into a standalone "encoding dictionary" that business can update in one place.
- Wrong incremental start point causing missing records: If the full sync runs but the time point isn't switched, the incremental start is still far in the past, producing duplicate writes or primary-key conflicts. Switch the time point only after the full sync completes.
- Special characters in customer names: Invoice titles may contain full-width symbols or newlines that fail target validation. Clean at the source side, earlier rather than later.
- Uncontrolled batch size: Submitting too many records at once causes the target to time out. The safe approach is to start small and scale up only after load testing.
When to Use and When Not to Use
Use when: Single- or multi-org e-commerce needs to unify customer records into the finance ERP, with relatively stable encoding and organization assignment. Don't use when: The source customer schema changes frequently, complex approval workflows are required, or the target disallows direct external writes.