[问题场景]:客户调用WebApi "销售出库单-保存" 接口,想更新已审核的销售出库单-物料跟踪明细分录;但是传入指定的接口报文,接口返回调用成功,但是打开销售出库单,物料跟踪明细分录并未更新。传入的报文如下:
{"IsDeleteEntry": "false", "NeedUpDateFields": ["FReceiptTime", "FTraceStatus","F_PAEZ_ConNo"], "NeedReturnFields": ["FOutStockTrace_FEntryId","FReceiptTime","FTraceStatus","F_PAEZ_ConNo"], "Model": {"FID": "853472", "FOutStockTrace": [{"FEntryId": "0", "F_PAEZ_ConNo": "425820240001226781", "FReceiptTime": "2024-11-01", "FTraceStatus": 3}]}}
[问题分析]:从提供的报文可以发现,传入的参数和格式都没有问题,想新增一行"物料跟踪明细",并且更新3个字段"FReceiptTime""FTraceStatus""F_PAEZ_ConNo";接口并未生效的原因有几点:
1、每个单据体中都在一个【关键字段】,新增分录时必须传入值,不然系统默认为当前行无效,不保存;
2、数据包的必录字段,如果没有设置默认值,报文中必录传入值;
3、参数"NeedUpDateFields"必须指定需要更新的字段,如果缺少更新字段,会导致更新失效;
[问题处理]:
1、物流跟踪明细数据包新增字段:【物流公司:FLogComId】【物流单号:FCarryBillNo 】【类型:FCarryBillNoType】;其中FLogComId是关键字段必传,FCarryBillNo 、FCarryBillNoType是必录字段,如果设置默认值可以不传;
2、参数"NeedUpDateFields"需要添加更新字段【物流公司:FLogComId】【物流单号:FCarryBillNo 】【类型:FCarryBillNoType】;
修改后报文如下:
{"IsDeleteEntry":"false","NeedUpDateFields":["FLogComId","FCarryBillNo ","FCarryBillNoType","FReceiptTime","FTraceStatus","F_PAEZ_ConNo"],"NeedReturnFields":["FOutStockTrace_FEntryId","FReceiptTime","FTraceStatus","F_PAEZ_ConNo"],"Model":{"FID":"853472","FOutStockTrace":[{"FEntryId":"0","FLogComId":{"FCODE":"xxxxxx"},"FCarryBillNo":"xxxxxx","FCarryBillNoType":"xxx","F_PAEZ_ConNo":"425820240001226781","FReceiptTime":"2024-11-01","FTraceStatus":3}]}}
推荐阅读