Sales Outbound "Pull & Update Flag" Strategy: A Lightweight Write-Back from MySQL to Kingdee Cloud
What This Strategy Solves
Many supply-chain integration teams run into the same small but annoying problem: an outbound order has already been written to MySQL, but Kingdee Cloud has no idea whether that order counts as "synced successfully." Each side runs on its own, and during reconciliation the operations team asks: did this order make it through? Where did it stall?
The "Pull & Update Flag" strategy for sales outbound orders does exactly one thing: pull already-processed outbound orders from MySQL and write the sync result (success/failure) back onto the original order in Kingdee Cloud. It is not a full master-data sync chain — it is the "flagging action" at the tail end of the chain. Without it, observability of the whole pipeline collapses. In on-premise customer environments, we usually implement this lightweight write-back on the Qeasy data integration platform (轻易云). It runs steadily and is easy to modify later.
Data Flow and Field Mapping
The data flow is short — think of it as two steps:
- Source side (Qeasy integration platform): acts as a relay puller. It invokes an empty-operation WebAPI to pull the key fields of processed outbound orders from MySQL by document number.
- Target side (Kingdee Cloud): receives the three fields and calls
batchSaveto write the sync flag back onto the original order.
Key field mapping:
| Meaning | Source field (from MySQL) | Target field (to Kingdee) | Notes |
|---|---|---|---|
| Document inner ID | INSTRUCTION_DOC_ID | FID | Used to locate the original order in Kingdee |
| Document number | INSTRUCTION_DOC_NUM | (tracing only) | Not written back, used for logging |
| Sync success flag | is_successx | F_FSYNCMOM | 1 = success, written as true/false |
One small habit we apply: centralized coding mapping. Qeasy handles boolean mapping like "1 → true, 0 → false" inside an expression (case '{{is_successx}}' when '1' then true else false end) rather than scattering it across every call point. If the source semantics change later, one edit is enough.
How to Configure on Qeasy
We usually split the configuration into three parts:
Source configuration
- API type: WebAPI / QUERY, method POST.
- Request body is empty (
request: []) because the trigger is schedule-driven and passes no parameters. - Response declares only three fields:
INSTRUCTION_DOC_ID,INSTRUCTION_DOC_NUM,is_successx. EnableautoFillResponseso the platform auto-parses the MySQL response. idCheckset to false — flag-style strategies do not need strict validation.
Target configuration
- API type: EXECUTE, method POST, calling Kingdee's
batchSave. FormIdisSAL_OUTSTOCK(the fixed business-object form ID for sales outbound orders in Kingdee).Operationis fixed tobatchSave.IsAutoSubmitAndAuditisfalse— flag only, no audit. Leave auditing to humans or upstream strategies.FIDcomes from{{INSTRUCTION_DOC_ID}};F_FSYNCMOMis computed via the case expression above.
Scheduling
- Source cron:
1 1 1 1 1(meaning: triggered only by upstream strategies, no active polling) — keeps the "on-demand trigger" semantics. - Target cron:
*/1 * * * *— tries every minute to push pending write-backs.
Implementation Steps
In customer on-site deployments, we typically roll this strategy out in three phases:
Phase 1: Baseline the incremental starting point First confirm on the MySQL side which outbound orders have already reached "sync success" and roughly how many. We do not touch live data directly. Instead, we run a "read-only" source pull on Qeasy, export the sample, and manually verify that the three fields are complete with no nulls.
Phase 2: Full-volume trigger for write-back Once the sample looks good, switch the strategy to live execution. Because this strategy is a "tail flagging" action, we typically adopt an incremental + full-volume dual-track pattern: incremental processing is triggered by upstream strategies (new orders only), while full-volume sweeps run via cron every minute (covering any historical backlog). The two do not conflict — whichever fires first wins.
Phase 3: Converge the scheduling frequency
After a week of stable operation, change */1 * * * * to */5 * * * * or longer to avoid pointless pressure on Kingdee. Meanwhile, configure retry and alert thresholds on Qeasy.
Lessons Learned from the Field
The strategy is small, but the pitfalls are real. On customer sites we have hit at least these:
- Classic mistake: setting
IsAutoSubmitAndAuditto true. Once enabled, the flag is submitted and audited together, and any later attempt to fix the flag alone requires un-auditing first. Our safe practice: flagging and auditing are always two separate steps, with humans or a separate strategy in between. - Classic mistake: leaving
idCheckenabled. In a "write a field back to a document head by FID" scenario, the strict idCheck validation will reject legitimate requests and deadlock production. - Classic mistake: writing boolean mapping inline at each call point. In one engagement, the source changed
is_successxfrom 1/0 to Y/N, and every order was suddenly flagged as false. Centralized mapping saved us — one place to edit, 30 seconds to deploy. - Pitfall: cron frequency not matching Kingdee performance. Per-minute write-backs can saturate Kingdee's API quota when volumes are large. The safe approach is to load-test first, then decide on frequency.
- Pitfall: network jitter in on-premise environments. After a source-pull timeout, you often end up with "pulled but not written back" dirty data. We recommend enabling transaction logs on Qeasy with automatic retry three times.
When to Use and When Not to
Use it when: you need to "flag" the processing result from an upstream system back onto the original ERP document — typical cases include sales outbound, purchase inbound, and production reporting.
Do not use it when: you need to write detail rows, trigger workflows, or require strong transactional consistency between source and target. Those scenarios deserve a full master-data sync chain, not this lightweight write-back.