Jerry Dubuke
Jerry Dubuke

Reputation: 186

QBSDK invoice query

I am using vb.net in visual studio to query my invoices. i get a list of invoice of interest, and as i iterate through the list, i see the for each invoice i have, the invoice.ORInvoiceLineRetList is nothing. here is a snippet of code, although i think i am doing everything right?

resp = SessMgr.DoRequests(msgReq)
resplist = resp.ResponseList
curResp = resplist.GetAt(0)
If curResp.StatusCode = 0 Then
    Dim invoiceList As IInvoiceRetList = curResp.Detail
    Dim curInvoice As IInvoiceRet
    Dim i As Integer
    For i = 0 To invoiceList.Count - 1
        curInvoice = invoiceList.GetAt(i)

if i breakpoint right after the last line, i see curInvoice, and its data (e.g. refnumber), but i need to get to the line items. can someone help? Thanks, Jerry

Upvotes: 3

Views: 508

Answers (1)

Ghost
Ghost

Reputation: 2226

If your IInvoiceQuery is called invoiceQuery, add this (just replace invoice query with your IInvoiceQuery objects name if it's called something else)

invoiceQuery.IncludeLineItems.SetValue(True)

before this

resp = SessMgr.DoRequests(msgReq)

and that should fix your problem

Upvotes: 4

Related Questions