解决webapi保存生产入库单时遇到“物料编码”是必填项问题
背景:webapi保存生产入库单,产品类型为主产品(手工新增联副产品没问题)
1、构建生产入库单保存的json数据如:
{
"Creator": "",
"NeedUpDateFields": [],
"NeedReturnFields": [],
"IsDeleteEntry": "true",
"SubSystemId": "",
"IsVerifyBaseDataField": "false",
"IsEntryBatchFill": "true",
"ValidateFlag": "true",
"NumberSearch": "true",
"InterationFlags": "",
"IsAutoSubmitAndAudit": "false",
"Model": {
"FID": 0,
"FBillType": {
"FNUMBER": "SCRKD02_SYS"
},
"FDate": "2019-02-28 00:00:00",
"FStockOrgId": {
"FNumber": "100"
},
"FPrdOrgId": {
"FNumber": "100"
},
"FOwnerId0": {
"FNumber": "100"
},
"FOwnerTypeId0": "BD_OwnerOrg",
"FIsEntrust": false,
"FEntity": [{
"FIsNew": true,
"FMaterialId": {
"FNumber": "3601002"
},
"FCheckProduct": false,
"FInStockType": "1",
"FProductType": "1",
"FUnitID": {
"FNumber": "Pcs"
},
"FMustQty": 100.0,
"FRealQty": 100.0,
"FBaseUnitId": {
"FNumber": "Pcs"
},
"FBaseMustQty": 100.0,
"FBaseRealQty": 100.0,
"FOwnerTypeId": "BD_OwnerOrg",
"FStockId": {
"FNumber": "CK001"
},
"FISBACKFLUSH": false,
"FWorkShopId1": {
"FNumber": "BM000001"
},
"FMoBillNo": "MO2019.02.20000211",
"FMoId": 110296,
"FMoEntryId": 110342,
"FMoEntrySeq": 1,
"FStockUnitId": {
"FNumber": "Pcs"
},
"FOwnerId": {
"FNumber": "100"
},
"FStockRealQty": 100.0,
"FSrcBillType": "PRD_MO",
"FSrcBillNo": "MO2019.02.20000211",
"FSrcEntryId ": 110342,
"FSrcEntrySeq": 1,
"FSrcInterId": 110296,
"FBasePrdRealQty": 100.0,
"FIsFinished": false,
"FStockStatusId": {
"FNumber": "KCZT01_SYS"
},
"FMOMAINENTRYID": 110342,
"FKeeperTypeId": "BD_KeeperOrg",
"FKeeperId": {
"FNumber": "100"
},
"FEntity_Link": [{
"FEntity_Link_FRuleId": "PRD_MO2INSTOCK",
"FEntity_Link_FSTableId": 0,
"FEntity_Link_FSTableName": "T_PRD_MOENTRY",
"FEntity_Link_FSBillId": 110296,
"FEntity_Link_FSId": 110342,
"FEntity_Link_FBasePrdRealQtyOld": 100.0,
"FEntity_Link_FBasePrdRealQty": 100.0,
}]
}]
}
}
2、验证数据的时候,出现了“物料编码”是必填项的错误
3、原因在于:生产入库单手工录入行产品类型只能为联副产品,系统在这部分进行了控制
4、解决:物料的生产页签属性勾选可为联副产品,json数据注意FProductType为1,此时可避免提示物料内码为必填项的问题
解决webapi保存生产入库单时遇到“物料编码”是必填项问题
本文2024-09-23 03:23:39发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-158579.html