Qeasy Cloud
Get Started

Authoritative Tutorial on the Kingdee Cloud Skylight Material Query API Field Handbook (Guanyi Cloud × Kingdee Sales Order Domain Practice)

· 高金凤· Engineering Best Practices· 9 views· 5 min read
GuanYi ERPKingdee Cloud物料主数据executeBillQuery轻易云Incremental Sync

What Problem Does This API Solve

Material master data in Kingdee Cloud Skylight is the backbone of sales, purchasing, inventory, and production. In multiple retail enterprises implementing the "Guanyi Cloud × Kingdee sales order" integration, almost everyone relies on the executeBillQuery API to paginate the BD_MATERIAL form by modification time, completing cross-system product archive alignment, license keep-alive, and material validation before downstream document writing. Although the strategy is named "for refreshing Kingdee license, do not close," it actually plays the role of a master data channel.

API Capability Overview

  • Entry point: Kingdee Cloud Skylight open platform executeBillQuery, form BD_MATERIAL (Material Master).
  • Authentication: Cloud Skylight user identity authentication (account + integration secret), accessed via HTTP/HTTPS WebAPI.
  • Request structure: FormId=BD_MATERIAL, FieldKeys (comma-separated field collection), FilterString (e.g., FModifyDate>='{{LAST_SYNC_TIME|datetime}}'), Limit (default 2000), StartRow (supports the {{PAGINATION_START_ROW}} variable).
  • Response structure: JSON array; each row is one material record, fields ordered per FieldKeys; referenced objects use the Main.SubProperty format (e.g., FBaseUnitId.FNumber).
  • Pagination/Incremental mode: Offset-based pagination via StartRow + Limit; incremental relies on the FModifyDate timestamp; strategy type is QUERY with Target as "empty write," pure query without writing to a target.
  • Scheduling suggestion: crontab */30 * * * *. In Qeasy, it is typically orchestrated as an independent "keep-alive query strategy" decoupled from formal sync strategies.

Typical Field Mapping

Field NameTypeMeaningPractical Notes
FMasterIdstringMaterial primary key, metadata idThe unique anchor for cross-system mapping; persist it first
FNumberstringMaterial code, metadata numberCore key for aligning with Guanyi Cloud product codes
FNamestringMaterial nameUsed in document display; confirm Chinese encoding
FBaseUnitId_FNumberstringBase unit codeInconsistent units directly break inventory conversion
FMaterialGroup_FNumberstringMaterial group codeAffects downstream document defaults
FErpClsIDstringMaterial attribute (finished/semi-finished/raw)Strongly tied to sales order type
FCreateOrgId_FNumber / FUseOrgId_FNumberstringCreation org / Usage orgMulti-org clients must distribute by org dimension
FIsSale / FIsPurchase / FIsProduce / FIsSubContract / FIsInventory / FIsAssetstringBusiness usage flagsMust validate before downstream writes, otherwise Kingdee rejects
FDocumentStatus / FForbidStatusstringData status / Forbidden statusOnly sync "audited and not forbidden" data
FStockId_FNumberstringDefault warehouse codeWrong warehouse mapping skews outbound orders
FSafeStockstringSafety stockNumeric type returned as string; conversion needed
FIsBatchManage / FIsKFPeriod / FIsSNManagestringBatch / Shelf-life / Serial number managementDetermines whether downstream documents must carry batch info
FExpPeriodstringShelf-lifeWatch out for unit (day vs. month)
FDefaultVendor_FNumberstringDefault vendor codeDefault value source for purchase orders
FSalePrice_CMK / FVIPPrice_CMK / FPurPrice_CMKstringRetail / VIP / Purchase unit price_CMK often denotes a specific org or price system; confirm meaning with customer
FGROSSWEIGHT / FNETWEIGHT / FLENGTH / FWIDTH / FHEIGHT / FVOLUMEstringWeight and dimensionsNumeric fields returned as strings; explicit cast required
FOldNumberstringOld material codeUsed for historical data migration tracing
FBARCODEstringBarcodeAligned with PDA / scanner scenarios
FPOBillTypeId_FNumber / FProduceBillType_FNumber / FSubBillType_FNumberstringPurchase / Production / Subcontract doc type codeDetermines downstream document type
FFixLeadTime / FVarLeadTimestringFixed / Variable lead timeAffects MRP calculation
FOrderQty / FMinQty / FMaxQty / FMaxPOQty / FMinPOQty / FIncreaseQtystringPurchase and sales batchesString numbers; beware of implicit loss during conversion

How to Configure on Qeasy

On the Qeasy Data Integration platform, this API is typically packaged as a "Kingdee Cloud Skylight Material Query" adapter. Configuration has three core steps:

  1. Access authentication: Fill in the Cloud Skylight account's API address, account, and integration secret; the platform automatically completes the OAuth-style identity exchange.
  2. Metadata configuration: Bind id to FMasterId and number to FNumber. Select fields via the visual "field mapper." Bind the incremental field uniformly to FModifyDate.
  3. Strategy orchestration: Since this strategy is essentially a "keep-alive + master data channel," choosing "empty write" for Target is sufficient. If you need to sync materials to Guanyi Cloud, create a separate SYNC strategy. In the Qeasy field mapper, you can drag-and-drop FNumber → Guanyi product code, FName → product name, FBaseUnitId_FNumber → base unit — no SQL required.

Cross-Scenario Practical Points

  1. Use FMasterId + FNumber dual anchor for idempotency: Relying solely on code easily conflicts across account sets during merging; a composite unique index of primary key + code is the most robust approach.
  2. FModifyDate must carry timezone: When Kingdee's timestamp lacks timezone, cross-day syncs suffer "yesterday's material only arrives today" delay. The safe practice is to persist in yyyy-MM-dd HH:mm:ss format within the FilterString.
  3. Unpack reference fields: Kingdee's nested structures like FBaseUnitId.FNumber must be flattened in the Qeasy mapper; otherwise the downstream ODS cannot persist nested objects.
  4. Business usage flags must be filtered up front: FIsSale='1', FForbidStatus='A' (not forbidden), FDocumentStatus='C' (audited) form the sales-order-eligible material trinity; none can be missing.
  5. Decouple keep-alive from business: Run keep-alive queries alone at */30 * * * * so they don't compete with formal syncs for license concurrency and avoid peak-hour rate limits.
  6. Price field suffixes need scrutiny: Suffixes like _CMK and _ORG carry different meanings across customer scenarios; the first thing to confirm when onboarding a project is "which org or price system does this suffix represent?"

Pitfall Review

  • Pitfall 1: Default Limit of 2000 hits the ceiling: Kingdee's max single response is 2000 rows; excess is truncated. Fix: In the Qeasy paginator, bind StartRow to {{PAGINATION_START_ROW}} and loop until the returned row count is less than Limit.
  • Pitfall 2: Numeric fields are all strings: Fields like FSafeStock and FExpPeriod return as strings even when they are numeric in business. Direct persistence yields the awkward "string 10 greater than string 9 but less than string 2." Fix: Add a toNumber() conversion in the mapper.
  • Pitfall 3: Forbidden materials still get synced: FForbidStatus='B' means forbidden; without filtering, they will be referenced by downstream sales orders as usable materials. Fix: Hard-filter FForbidStatus='A' in the FilterString.
  • Pitfall 4: Multi-org clients experience material mix-ups: The same material may share a code across orgs but have different FMasterId values; cross-org sync will overwrite org A's material into org B. Fix: Use FUseOrgId_FNumber as a partition key when writing downstream.
  • Pitfall 5: _CMK price field returns nothing: In some customer scenarios, the org corresponding to _CMK is unauthorized, and the API returns null without erroring. Fix: In Qeasy, configure "skip on null + log alert" for this field to avoid silent loss.

When to Use

Choose this API when you need to incrementally pull material master data from Kingdee Cloud Skylight, prepare preconditions for sales order sync, or simply keep the API license alive. If your downstream is not Kingdee (e.g., writing to a custom OMS), it is recommended to first extract data via a QUERY strategy, then build a separate SYNC strategy to write to the target system, avoiding tight coupling. For pure write scenarios, use the save/batchSave APIs instead of reusing this query.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/engineering/hb-p2-202-5ad3

Comments