[英]Intuit Quickbooks Online API - How to get purchases
I'm using Intuit's .NET SDK for QBO, and am attempting to get a list of purchases from my qbo account. 我正在将Intuit的.NET SDK用于QBO,并试图从我的qbo帐户中获取购买清单。 Here's my C# code...
这是我的C#代码...
var qboCashPurchaseQuery = new Intuit.Ipp.Data.Qbo.CashPurchaseQuery();
qboCashPurchaseQuery.PageNumber = 1;
qboCashPurchaseQuery.ResultsPerPage = 100;
var results = qboCashPurchaseQuery.ExecuteQuery<Intuit.Ipp.Data.Qbo.CashPurchase(context).ToList();
grdQuickBooksCustomers.DataSource = results;
I get a table with the number of records matching the number of purchases I expect, but the actual data returned is not what I need. 我得到一个表,记录的数量与我期望的购买数量相匹配,但是返回的实际数据不是我所需要的。
This is the columns and the first row of data I get back: (sorry for the formatting) 这是我得到的数据的列和第一行:(很抱歉格式化)
SyncToken Synchronized IdsType
0 Intuit.Ipp.Data.Qbo
This bit of code returns the same kind of weird data for some other functions such as InvoiceQuery. 对于某些其他功能,例如InvoiceQuery,此代码段返回相同类型的怪异数据。 What am I doing wrong here to get this data?
我在这里获取数据时做错了什么? How might I actually return the detailed purchase data I need?
我实际上如何返回所需的详细购买数据?
string q = "Select * from Purchase Where PaymentType='Cash' STARTPOSITION 1 MAXRESULTS 100";
dynamic Purchaselist = purchaseQueryService.ExecuteIdsQuery(q);
CashPurchase cashpurchase = new CashPurchase();
foreach (CashPurchase oCash in Purchaselist) {
//do something
}
var purchase = new Purchase();
var purchases = ds.FindAll(purchase, 0, 500);
That's how we query our datasets. 这就是我们查询数据集的方式。 You have to repeat the query if you've got more than 500 items.
如果您有500多个商品,则必须重复查询。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.