Sales Order Sync in Practice: A Single-Strategy Tutorial from Business System to Kingdee Cloud
What This Strategy Solves
In real projects with retail and distribution companies, the business system generates hundreds to thousands of audited sales orders every day, while finance and supply chain data lives in Kingdee Cloud. Without timely order sync, finance cannot see revenue, inventory deductions drift, and shipments have no source document.
This strategy does one thing only: push audited sales orders from the business system into Kingdee Cloud as SAL_SaleOrder, with a 10-minute heartbeat, auto-submit and audit. It bridges the "business order → Kingdee order" gap so downstream inventory, logistics, and finance all speak the same order.
Data Flow and Field Mapping
Overall flow: Business System (QUERY pull) → Qeasy transformation layer → Kingdee Cloud (EXECUTE submit).
Header field mapping:
| Source Field | Target Field | Mapping Type | Rule |
|---|---|---|---|
| orderNo | FBillNo | DIRECT | {{orderNo}} direct |
| approveDate | FDate | DIRECT | {{approveDate}} direct |
| agentName | FCustId | COLLECTION | _mongoQuery join by customer name, return FNumber |
| customerAddress | F_WDZN_Text | DIRECT | {{customerAddress}} direct |
| customerName | FLinkMan | DIRECT | {{customerName}} direct |
| customerMobile | FLinkPhone | DIRECT | {{customerMobile}} direct |
| - | FBillTypeID | CONSTANT | XSDD01_SYS |
| - | FSaleOrgId | CONSTANT | 100 |
Line items: source productItemEntity (nested array) → target FSaleOrderEntry, line fields (model→FMaterialId_FNumber, productPrice→FPrice, qty→FQty) mapped row-by-row, the platform loops the array automatically.
How to Configure in Qeasy
We use Qeasy (轻易云数据集成平台) for this strategy, configured as a source collector plus a target writer.
Source (QUERY): API /Kingdee/GetSaleOrderList, request param ApproveDate={{LAST_SYNC_TIME}} for incremental pull; primary key orderNo, autoFillResponse=true.
Target (EXECUTE): FormId SAL_SaleOrder, Operation BatchSave, IsAutoSubmitAndAudit=true, IsVerifyBaseDataField=true. FBillNo passes {{orderNo}}; FCustId uses _mongoQuery to look up the customer code strategy, matching agentName to FName and returning FNumber; FSaleOrderEntry.value points directly to the productItemEntity array.
A common pattern on Qeasy is "centralized code mapping" — customer, material, and document number mappings live in dedicated small strategies, and the order strategy only references them via cross-lookup, avoiding script bloat.
Implementation Steps
Step 1: Set the incremental starting point. Do a full backfill with a historical timestamp first to validate mapping and joins; then move LAST_SYNC_TIME to the latest audit time and switch to incremental.
Step 2: Pre-stage joins. Stabilize the "Query Kingdee Customer Code" and "Material to Business System" strategies first so that BD_Customer and material master data exist in Kingdee. The order strategy depends on them implicitly — empty lookup results will fail validation.
Step 3: Phased scheduling. Source */10 7-22 * * * (every 10 minutes during business hours), target */10 * * * * (every 10 minutes all day) — real-time peak in the day, tail-catching at night.
Step 4: Watch three things after go-live: join hit rate, target rejection logs, and whether LAST_SYNC_TIME advances with each successful sync. The "incremental plus full reconciliation dual-track" pattern on Qeasy works well here — daily incremental, weekly full reconciliation.
Pitfall Retrospective
-
agentName mismatch is the biggest trap. The customer join relies on exact match between agentName and Kingdee FName. If the business system uses a renamed or short form, FCustId comes back empty and the order is rejected. Normalize customer names on the master data side, or add a fuzzy match fallback before the join.
-
Line items swallowed. When the source productItemEntity is empty, the target FSaleOrderEntry is also empty. Whether Kingdee allows empty-detail sales orders must be confirmed in advance — always test the "empty detail" case before go-live.
-
LAST_SYNC_TIMEnot maintained. The worst fear in incremental sync is losing or rolling back the timestamp. A failed batch that rolls back the timestamp causes missing orders. The safe practice is to advance the timestamp only after the batch is successfully persisted. -
Material code mismatch. The model inside productItemEntity must match Kingdee material FNumber exactly, or IsVerifyBaseDataField=true throws an error. This is covered by the "Material to Business System" pre-strategy.
-
Hard-coded sales org and doc type. FSaleOrgId=100 and FBillTypeID=
XSDD01_SYSare constants. For multi-org or multi-doc-type enterprises, parameterize them — otherwise changing org requires editing the strategy.
Suitable and Unsuitable Scenarios
Suitable: single-org retailers and distributors with high sales order volume and strict reconciliation SLAs, where the business system is the order entry point and Kingdee is the back-end finance/inventory hub.
Unsuitable: multi sales org, complex groups that need to split document types by customer or product line, or scenarios with complex source order state machines requiring bidirectional sync — a single sync strategy cannot carry these, and a dedicated orchestration is needed.