我刚刚测试了有关如何在 Acumatica 上使用 Web 服务使用过滤器导出的示例代码。但它完全忽略了过滤器。
DateTime syncDate = new DateTime(2016, 1, 1);
WebReference.Screen context = new WebReference.Screen();
context.CookieContainer = new System.Net.CookieContainer();
context.AllowAutoRedirect = true;
context.EnableDecompression = true;
context.Timeout = 1000000;
context.Url = "http://<MYACUMATICAINSTANCE>/(W(64))/Soap/IN202500.asmx";
context.Login("<MYUSER>", "<MYPASS>");
WebReference.Content IN202500 = context.GetSchema();
context.Clear();
string[][] result = context.Export(
new WebReference.Command[]{
IN202500.StockItemSummary.ServiceCommands.EveryInventoryID,
IN202500.StockItemSummary.InventoryID,
IN202500.StockItemSummary.Description,
IN202500.WarehouseDetails.WarehouseWarehouseID,
IN202500.WarehouseDetails.QtyOnHand
},
new WebReference.Filter[]{
new WebReference.Filter { Field = new WebReference.Field { ObjectName = IN202500.StockItemSummary.ItemStatus.ObjectName, FieldName = IN202500.StockItemSummary.ItemStatus.FieldName }, Condition = WebReference.FilterCondition.Equals, Value = "Activse", Operator = WebReference.FilterOperator.And },
new WebReference.Filter { Field = new WebReference.Field { ObjectName = IN202500.StockItemSummary.InventoryID.ObjectName, FieldName = "LastModifiedDateTime" }, Condition = WebReference.FilterCondition.Equals, Value = syncDate.ToLongDateString(), Operator = WebReference.FilterOperator.And }
},
5, false, false
);
foreach (string[] item in result)
{
Console.WriteLine(
item[0] + ";" +
item[1] + ";" +
item[2] + ";" +
item[3] + ";"
);
}
注意坏过滤的坏syncDate
和坏条件值Activse
,它应该不返回任何结果,而是返回所有结果。