如何通过Acumatica SalesOrder API获取含批次/序列号的明细及分配信息
解决Acumatica SalesOrder API获取行明细批次/序列号的方法
要获取销售订单行明细对应的批次/序列号(即Allocations信息),你需要在OData请求中嵌套展开子集合——因为Allocations是SalesOrderDetail的下级关联对象,而非SalesOrder的直接子对象。
正确的请求路径
将原请求的$expand参数修改为嵌套格式,完整路径如下:
entity/defaultext/20.200.001/SalesOrder?$expand=details($expand=allocations)&$top=100
说明
- 原参数
$expand=details仅展开销售订单的行明细(SalesOrderDetail);添加($expand=allocations)后,会同时展开每个行明细下的Allocations集合。 - 展开后,每个
details对象中会包含allocations数组,其中包含LotNbr(批次号)、SerialNbr(序列号)等你需要的字段。
内容的提问来源于stack exchange,提问作者mtnNerds
相关产品推荐
相关产品推荐

