EventDay / Infusionsoft.net

A C# Wrapper around the Infusionsoft.com API
15 stars 22 forks source link

DataService not returning expected records for Invoice and InvoiceItem tables #21

Open piranout opened 10 years ago

piranout commented 10 years ago

I would expect this query to return every InvoiceItem from 2014. Instead, it returns only items created this month, 2014-05. It's worse for Invoice; no records are returned for any query I've been able to craft yet. (In contrast, Companies & Contacts produce exactly the expected query results.)

            // Expecting all 2014 InvoiceItems
            // returned only 2014-05 InvoiceItems
            var queryData = new XmlRpcStruct() { { "DateCreated", "2014%" } };
            var invoiceItems = client.DataService.Query(
                    table: "InvoiceItem",
                    limit: 1000,
                    page: 1,
                    queryData: queryData,
                    selectedFields: new[]
                    {
                        "Id", "InvoiceAmt", "DateCreated", "Description", "Discount", "OrderItemId"//, "CustomFields"
                    }) 
                .ToList();
mfairch commented 10 years ago

Is it possible that you have more than 1000 Invoices from 2014-05? I think its likely since you are asking for the InvoiceItem table.

piranout commented 10 years ago

No, there are under 300 invoices in this period. Under 350 invoice items as well. There are no "Get" methods on the Invoice service, so I can't use that as a working reference to compare the raw RPC calls. I did compare the Invoice & InvoiceItem calls against a Company and Contact RPC calls that work as expected, and I don't see any significant structural differences in the XML.

jhallam3 commented 9 years ago

Hi there.

Your code is fine... Numbering starts at 0.

try page = 0.

my code is and works.. var queryData = new XmlRpcStruct() { { "DateCreated", "2015%" } }; var invoiceItems = client.DataService.Query( table: "InvoiceItem", limit: 1000, page: 0, queryData: queryData, selectedFields: new[] { "Id" //, "InvoiceAmt", "DateCreated", "Description", "Discount", "OrderItemId"//, "CustomFields" }) .ToList();