Author Topic: Invoice Query Failing  (Read 1493 times)

hudi42

  • Member
  • *
  • Posts: 8
Invoice Query Failing
« on: March 27, 2014, 11:25:37 AM »
Hi,

I'm trying to Query an invoice, to see whether or not it was paid, in order to update the status in FM. I'm trying to get the field 'paidstatus' using the scripts (attached) but can't seem to get it right.
The order of the script steps should be correct, I'm thinking it's something else...Help?



Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: Invoice Query Failing
« Reply #1 on: March 27, 2014, 01:06:30 PM »
Your script shows that you're passing a ListID element in your Invoice Query. Invoices are identified by their TxnID. If you've extracted the correct value to your INV::QB_Ref_Number field (the value of that field should be the TxnID, not the RefNumber, that was returned in the Response to your InvoiceAdd Request) you'll need to replace "ListID" with "TxnID" in your AddFieldWithValue line.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852

hudi42

  • Member
  • *
  • Posts: 8
Re: Invoice Query Failing
« Reply #2 on: April 01, 2014, 01:13:40 AM »
Thank You Geoffrey.
What will that query return if the "paidStatus" field is empty? Will that return an error or is there an "unpaid" status that I can pull into FM. I'm trying to see where the error is coming from, that's why I ask.

Thanks!

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: Invoice Query Failing
« Reply #3 on: April 01, 2014, 10:13:06 AM »
Are you working with a desktop version of QB? I don't know if that's an element of the Online Edition, but the closest you come in the desktop version is the IsPaid element. It's never empty--it always returns a a Boolean value.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852

hudi42

  • Member
  • *
  • Posts: 8
Re: Invoice Query Failing
« Reply #4 on: April 04, 2014, 10:43:15 AM »
Hey Geoffrey,

Thanks for the quick reply as always.

I'll try 'isPaid' as the subject of my query, but where are you finding a list of those elements? I'm using this (link below) as a reference but do not see in the 'Invoice Query' a field called 'isPaid'. I see 'paidStatus' but no 'isPaid'.
 
 https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html

Thanks

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: Invoice Query Failing
« Reply #5 on: April 06, 2014, 07:26:03 PM »
I see where the confusion arises--PaidStatus is an InvoiceQuery Request element, but is not an element of the InvoiceQuery Response. You'll want to make sure you're looking at the Response section of the OSR when parsing values that came back from QB.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852