Authoritative Tutorial on Kingdee Cloud Skylight Material Query Interface Field Handbook (Supply Chain Master Data Integration)
What This Interface Solves
In retail e-commerce and ERP unified scenarios, material/product master data is the foundation for all supply chain documents such as sales, purchasing, inventory, and transfers. We often need to sync material master data from the ERP to front-end systems, or reversely verify whether written records are correct. The executeBillQuery (Query Kingdee Material) interface is designed to paged-pull approved material master records by modification time, serving as the core entry point for bidirectional material master sync and post-write validation.
Interface Capability Overview
- Authentication: Kingdee Cloud Skylight OAuth2.0 / application secret dual-factor authentication. In the Qeasy adapter, this is encapsulated as a unified credential configuration panel, requiring no manual token exchange logic.
- Request Structure:
POSTto theexecuteBillQueryendpoint with FormId fixed asBD_MATERIAL, combining filter conditions viaFilterString, typicallyFUseOrgId='7000' AND FDocumentStatus='C' AND FModifyDate>='{{last_run_time}}'. - Response Structure: Kingdee's standard
Result→Rowsarray, where each Row is a set of key-value field pairs, and related objects are returned in thefield.sub-propertyformat (e.g.,FBaseUnitId.FNumber). - Pagination/Incremental Mode: Cursor pagination based on
LimitandStartRow, combined withFModifyDatefor incrementality; Qeasy defaults to 2000 records per page, auto-rolling cursors by modification time, with breakpoint resumption managed by the platform. - Scheduling Cadence: Strategy-level crontab
1-59/5 7-23 * * *, running every 5 minutes during working hours with reduced frequency at night.
Typical Field Mapping
| Field Name | Type | Meaning | Practical Notes |
|---|---|---|---|
| FMasterId | string | Material primary key, id in metadata | Unique anchor for cross-system association, must be used as external_id |
| FNumber | string | Material code, number in metadata | Business reference key, unique within org, serves as primary match key |
| FName | string | Material name | Used for display, not as match key |
| FSpecification | string | Specification/model | Directly maps to the retail system's specification field |
| FBaseUnitId_FNumber | string | Base unit code | Corresponds to FBaseUnitId.FNumber, translated to front-end unit dictionary |
| FBaseUnitId | string | Base unit name | Corresponds to FBaseUnitId.FName, human-readable field |
| FMaterialGroup_FNumber | string | Material group code | Used for category tree mapping |
| FErpClsID | string | Material attribute (finished/semi-finished/raw) | Determines whether to participate in production/subcontract logic |
| FDocumentStatus | string | Approval status | Must filter C (approved) |
| FForbidStatus | string | Forbid status | Forbidden materials must be delisted on the front-end |
| FUseOrgId_FNumber | string | Use organization code | Key filtering dimension in multi-org architecture |
| FCreateOrgId_FNumber | string | Create organization code | Distinguishes material ownership |
| FIsSale / FIsPurchase / FIsProduce | string | Business usage switches | Controls document types the material can participate in |
| FIsBatchManage / FIsKFPeriod / FIsSNManage | string | Batch/expiry/serial number | Determines inventory dimensions, must be synced |
| FStockId_FNumber | string | Default warehouse code | Aligns with warehouse master data |
| FSafeStock | string | Safety stock | Note unit conversion for numeric types |
| FJNSNCODE | string | Barcode/SN code | Core field for scanning scenarios |
| FLENGTH / FWIDTH / FHEIGHT / FGROSSWEIGHT / FNETWEIGHT | string | Dimensions and weight | Mostly mm/kg, requires unified conversion |
| FPurchaseOrgId_FNumber | string | Purchase organization code | Purchase business attribution |
| FCategoryID | string | Inventory category | Related to accounting subject mapping |
How to Configure on Qeasy
- Adapter: Qeasy has a built-in "Kingdee Cloud Skylight executeBillQuery" adapter; just fill in AppId/AppSecret/tenant credentials. Select
BD_MATERIALas the FormId, and the platform automatically injects pagination and incremental cursors. - Field Mapper: The platform automatically identifies
FMasterIdasidandFNumberasnumber. Other fields are expanded via thefield_sub-propertysyntax (e.g.,FBaseUnitId.FNumber→FBaseUnitId_FNumber). Qeasy's field mapper automatically generates the target column structure without manual JSON. - Filter Template: Built-in "by modification time incremental" template, just configure use organization and approval status constants.
- Target Configuration: This type of pure query strategy selects "Write No-Op" as Target, with the chain only running extraction and landing to the intermediate database.
- Scheduling: The platform provides a visual crontab editor, equivalent to expressions like
1-59/5 7-23 * * *.
Cross-Project Practical Points
- Use
FMasterId+FNumberas composite primary key: In real scenarios, relying solely onFNumbercauses collisions in cross-org contexts; dual-writing primary key and code is more robust. - Must filter
FDocumentStatus='C': Field values of materials in pending/draft state are volatile, pulling them in pollutes downstream. - Incremental cursor must be persisted to reliable storage: Qeasy defaults to storing the
FModifyDatelast value to the strategy state table; do not let the target side overwrite it. - Related object fields need secondary expansion:
FBaseUnitId.FNumberdoes not auto-flatten; either use the mapper renaming rules or explicitly split in scripts. - Unify units and numeric field conversion: Length/weight often carry ERP units and must be aligned with the unit dictionary before being written to front-end SKUs—this is the easiest place to fail.
- Validate after write enablement: The practice behind "Data Write After Enablement" means the query strategy runs empty before the write strategy, confirming no duplicates before officially running the chain, minimizing regression cost.
Pitfall Recap
- Pitfall 1: Not filtering approval status caused downstream to receive draft-state materials, triggering inventory archive creation failure. Fix: Force
FDocumentStatus='C'in FilterString and tick "Approved Only" in Qeasy filter templates. - Pitfall 2: Using related fields directly as strings: The full
FBaseUnitIdreturn is an object; without expansion it writes a JSON string into the database. Fix: Use Qeasy field mapper's_FNumberexpansion rule to auto-flatten. - Pitfall 3: Incremental time window regression: Server clock drift caused some records to be missed. Fix: Add a 5-minute regression tolerance to the incremental cursor in Qeasy to avoid boundary loss.
- Pitfall 4: Multi-org material duplication: Pulling without
FUseOrgIdfilter caused cross-org materials to be written multiple times. Fix: Fix the use organization in the strategy, or split strategies by org dimension. - Pitfall 5: Scheduling period overlapping nightly batch processing: 5-minute polling colliding with ERP nightly closing caused slow or even timed-out responses. Fix: Reduce frequency at night, restore high frequency during the day; the platform provides time-slot scheduling configuration.
When to Use
Applicable scenarios: ERP ↔ front-end system material master bidirectional sync, post-write consistency validation, cross-org material distribution, batch material pulling for cold start of new systems. Not applicable: Real-time single-record queries (use the document detail interface), draft-state material collection, and sync of non-BD_MATERIAL business objects.