Qeasy Cloud
Get Started

Kingdee Cloud Material Query API Field Handbook (for ZhiZhang Platform)

· 吕修远· Engineering Best Practices· 6 views· 4 min read
JushuitanKingdee Cloud物料主数据executeBillQuery轻易云供应链集成字段手册

What This API Solves

The material master data (BD_MATERIAL) in Kingdee Cloud is the central foundation of an enterprise supply chain. When platforms like ZhiZhang, e-commerce middleware, or logistics systems need to align material codes with Kingdee, retrieve specifications/barcodes/dimensions, or confirm default sales and shipping organizations, executeBillQuery is typically used in a read-only fashion to pull material master data and hand it to downstream systems for mapping or initialization. This strategy queries only and does not write back, making it suitable as a "baseline snapshot" or the first step in an upstream sync chain.

API Capability Overview

  • Authentication: Kingdee Cloud WebAPI with user/app-key based authentication, invoked via the API gateway.
  • Method: POST, endpoint executeBillQuery, business object FormId fixed as BD_MATERIAL.
  • Request Body: Includes FormId, FilterString, Limit (default 2000), StartRow (default 0), and optional field selection (FieldKeys).
  • Response Structure: A two-dimensional array returned in the Result field, where the first row is the field names followed by data rows; metadata uses FNumber for both id and number.
  • Pagination: Offset-based pagination using StartRow + Limit; loop until the returned row count is less than Limit.
  • Incremental Mode: FilterString constrains FApproveDate > '{{HOURE_AGO_5|datetime}}', syncing only materials approved within the last 5 hours. Typical schedule is 0-59/5 7-23 * * * (every 5 minutes from 07:00–23:59).
  • Target Side: Target is configured as a "write-empty" operation — a pure query strategy with no target system writes.

Typical Field Mapping

Field NameTypeMeaningPractical Notes
FMATERIALIDstringEntity primary keyUnique identifier in Kingdee; the master index for cross-system linking and dedup
FNumberstringMaterial codeBusiness key; both id and number use FNumber; one-to-one mapping with ZhiZhang product code
FNamestringNameFor display and human identification
FSpecificationstringSpecificationOften used as subtitle in ZhiZhang
FDescriptionstringDescriptionLong text, may not be enabled in some Kingdee versions
FMaterialGroup_FNumber / FNamestringMaterial group code/nameFilter: LEFT(FMaterialGroup.FNumber,2)='01'
FBasePropertystringMaterial group code (extended)May overlap/relate with FMaterialGroup
FErpClsIDstringMaterial attributeDistinguishes finished goods / raw materials / semi-finished
FCategoryIDstringInventory categoryMandatory filter
FCreateOrgId_FNumberstringCreation organizationMandatory filter
FUseOrgId_FNumberstringUse organizationMandatory filter; strategy constrains to 100
FIsSalestringAllow saleMandatory filter; boolean flag
FStockId_FNumberstringDefault warehouseDefault stock warehouse code
FApproveDatestringApproval dateCore field for incremental filtering
FBaseUnitId_FNamestringBase unitLabel says "base unit code" but value is often the name — verify per environment
FBARCODEstringBarcodeKey field for ZhiZhang scanning
FLENGTH / FWIDTH / FHEIGHTstringLength / Width / HeightUsed for logistics volume calculation and freight estimation
F_POKM_SaleOrgstringDefault sales organizationExtended field; POKM is the extension identifier
F_POKM_StockOrg1stringDefault shipping organizationExtended field; relied on by logistics/warehousing

How to Configure on QeasyCloud

In the QeasyCloud Data Integration Platform, this API is typically encapsulated by the "Kingdee Cloud Query Adapter" with three configuration steps:

  1. Adapter Selection: Choose Kingdee Cloud - executeBillQuery as the source adapter, set FormId to BD_MATERIAL, and configure authentication using the Kingdee WebAPI user authorization.
  2. Metadata Mapping: The QeasyCloud field mapper automatically converts the two-dimensional response array into structured fields. FNumber serves as both id and number, and the platform uses it for idempotent deduplication; FApproveDate is bound directly to the incremental variable HOURE_AGO_5.
  3. Scheduling and Target: Set Target to "write-empty" or route it to the next processing node (e.g., "Kingdee Material => QeasyCloud => ZhiZhang Product"). QeasyCloud's built-in scheduler parses the 0-59/5 7-23 * * * expression directly, eliminating the need for additional scripts.

Cross-Scenario Best Practices

  1. Use FNumber as the Business Key: Across multiple customer projects, metadata consistently maps both id and number to FNumber — the most reliable anchor for cross-system alignment.
  2. Organization Dimensions Are Mandatory: FCreateOrgId, FUseOrgId, FCategoryID, and FIsSale are almost always required in production; otherwise Kingdee returns massive result sets and times out.
  3. FilterString Defines the Incremental Cadence: Use FApproveDate with HOURE_AGO_5 to enforce a 5-minute window — timely without full scans; running in two phases (full + incremental) is the safe approach.
  4. Extended Fields Must Be Explicitly Selected: F_POKM_SaleOrg, F_POKM_StockOrg1, F_POKM_XNFL and similar extended fields must be declared in FieldKeys; otherwise they are not returned by default.
  5. Base Unit Label vs Value Mismatch: FBaseUnitId_FName is labeled "base unit code" but typically returns the name. Add a "unit normalization" cleansing node in QeasyCloud when mapping.
  6. Don't Set Limit Too High: The default 2000 is an empirical safe value. In production, requesting more than 5000 rows in a single call frequently causes timeouts or memory pressure on Kingdee.

Troubleshooting Replays

  • Filter Order Causes Index Invalidation: Putting LEFT(FMaterialGroup.FNumber,2)='01' first and FUseOrgId.FNumber='100' later caused full table scans in some projects — the safe approach is to put high-selectivity fields (organization, date) first.
  • F_POKM_XNFL in FilterString but Not in Response: This is Kingdee's common pattern of "filter but don't expose" for extended fields; newcomers often think it's a missing field, but it is by design.
  • Approval Date Time Zone Mismatch: The Kingdee server's default time zone differs from local by 8 hours, causing HOURE_AGO_5 to pull what looks like "5 hours ago" but is actually "13 hours ago". Explicitly set the time zone in QeasyCloud.
  • Multiple FBARCODE Rows: A single material may have multiple barcodes in Kingdee, and the API returns them as separate rows — downstream ZhiZhang must merge and deduplicate.
  • Misunderstanding Limit: Many engineers treat Limit as "only this many records total" on first contact with executeBillQuery, not realizing it is the page size — you must loop until the returned count is less than Limit.

When to Use

This API fits scenarios where you need to periodically pull material master data from Kingdee Cloud for downstream ZhiZhang, e-commerce middleware, or logistics systems to align or initialize. It is not suited for write-back, triggering Kingdee workflows, or real-time reverse lookups. An incremental cadence of 5–15 minutes is recommended, and it performs best when the material scale is within the hundreds of thousands.

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

Comments