jhiversen
jhiversen

Reputation: 11

QBD Query Documentation

I have read the documentation on creating QBD Queries here: https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0100_ipp_.net_devkit/query_filters/quickbooks_desktop

And the full SDK documentation here: http://developer-static.intuit.com/SDKDocs/QBV2Doc/IntuitDataServicesSDK/

I'm trying to build a query in C# and .Net SDK 2.0 that takes a customer number from a text field and returns all invoices by that customer. Here's what I have so far:

var qbdInvoiceQuery = new Intuit.Ipp.Data.Qbd.InvoiceQuery();   
qbdInvoiceQuery.Item = "1";
qbdInvoiceQuery.ChunkSize = "10";
var qbdInvoices = qbdInvoiceQuery.ExecuteQuery<Intuit.Ipp.Data.Qbd.Invoice>(context).ToList();
grdQuickBooksInvoices.DataSource = qbdInvoices;

This works well, but I get all invoices. The query example at the above link is good, but I can't find documentation for filters beyond the CDCAsOf field.

Upvotes: 1

Views: 202

Answers (1)

Jarred Keneally
Jarred Keneally

Reputation: 1931

You need to create a filter on the Invoice query to get the invoices that belong to a certain customer. You can do something like this.

<?xml version="1.0"?>
<InvoiceQuery xmlns="http://www.intuit.com/sb/cdm/v2"><IncludeTagElements>Invoice/Header/CustomerName</IncludeTagElements>
</InvoiceQuery>

thanks,
Jarred

Upvotes: 1

Related Questions