通过Web服务端点过滤通用查询

时间:2016-05-19 20:56:21

标签: acumatica

我们创建了一个通用查询,以显示位置的内容,参见附件图片。

GI Tables Setup GI Relations Setup

条件

INLocationStatus.QtyOnHand, Is Greater Than, 0

结果网格

InLocationStatus, InventoryID, INLocationStatus.InventoryID  
InLocationStatus, LocationID, INLocationStatus.LocationID  
InLocationStatus, QtyAvail, InLocationStatus.QtyAvail  
InLocationStatus, QtyOnHand, InLocationStatus.QtyOnHand  
InLocationStatus, SiteID, InLocationStatus.SiteID  
InventoryItem, Descr, InventoryItem.Descr

我们已将此添加到我们的Web服务端点定义中,并可使用以下代码成功调用GI。

var temp = c.GetList(new OzLocationDetails {}, false).Cast<OzLocationDetails>();

但是,当我们尝试向此添加过滤条件时,我们会收到错误

Location = new StringValue { Value = "OZRECV" }

返回的错误是

An unhandled exception of type 'System.ServiceModel.FaultException' 
occurred in mscorlib.dll

Additional information: System.Web.Services.Protocols.SoapException: 
Server was unable to process request. ---> 
PX.Api.ContractBased.OperationDoesNotSupportValuesException:


Operation does not support values.

at PX.Api.ContractBased.EntityService.GetList(EntityGateBase gate, 
String version, String name, EntityImpl entity, Boolean returnFullEntities,
Boolean ignoreValueFields, PXGraph graph)

at PX.Api.ContractBased.Soap.EntityGate.GetList(Entity entity, 
Boolean returnFullEntities)

--- End of inner exception stack trace ---

1 个答案:

答案 0 :(得分:1)

我知道这听起来违反直觉,但要检索通用查询的内容并检索结果,您需要进行Put()调用。此调用将返回单个实体,其Details属性包含通用查询返回的所有行。