这是我的代码:
ISalesOrderQuery salesOrdersQueryRq = requestMsgSet.AppendSalesOrderQueryRq();
salesOrdersQueryRq.IncludeLineItems.SetValue(true);
IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet);
IResponse response = responseMsgSet.ResponseList.GetAt(0);
ISalesOrderRetList salesOrderRetList = (ISalesOrderRetList)response.Detail;
上面的代码获得所有销售订单,但我只需要从“日期”到“日期”获得销售订单,或者销售订单有SO编号=“SOnumber”,是否有任何建议?
答案 0 :(得分:1)
您可以在执行查询时设置TxnFilter以限制响应。每种交易类型都有不同的过滤器可以设置,尽管很多都使用类似的过滤器。 OSR显示了每种交易类型可用的过滤器:https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html
ISalesOrderQuery salesOrdersQueryRq = reqeustMsgSet.AppendSalesOrderQueryRq();
salesOrderQueryRq.IncludeLineItems.SetValue(true);
// Use these lines for date range filter
salesOrdersQueryRq.ORTxnNoAccountQuery.TxnFilterNoAccount.ORDateRangeFilter.TxnDateRangeFilter.ORTxnDateRangeFilter.TxnDateFilter.FromTxnDate.SetValue(fromDate);
salesOrdersQueryRq.ORTxnNoAccountQuery.TxnFilterNoAccount.ORDateRangeFilter.TxnDateRangeFilter.ORTxnDateRangeFilter.TxnDateFilter.ToTxnDate.SetValue(toDate);
// Use these lines for reference number query
salesOrdersQueryRq.ORTxnNoAccountQuery.RefNumberList.Add(soNumber);
IMsgSetResponse responseMsgSet = SessionManager.DoRequests(requestMsgSet);