Author Topic: BillQuery Script Example  (Read 1733 times)

trebor

  • Member
  • *
  • Posts: 57
BillQuery Script Example
« on: July 25, 2014, 02:01:46 PM »
I can query Items, customers, vendors, invoices, Estimates, but for the life of me I cannot pull Bills out of QB.

Does anyone have a sample BillQuery Script.  I am doing something wrong.

I took an existing Query script that works fine and made some minor changes to make it a BillQuery (Changed the ItemQuery to BillQuery, a couple other minor changes) but no go.  This has worked for me in the past, taking a working script and tweaking it to pull other info.

Any examples would be appreciated.....




Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: BillQuery Script Example
« Reply #1 on: July 25, 2014, 02:34:09 PM »
I don't have a sample script, but think more detail might help me or someone else point you in the right direction. Are you getting an error message? If so, what is it? The script you modified may not have been a good starting point, since ItemQuery returns a ListID while BillQuery returns a TxnID.

HTH!

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

trebor

  • Member
  • *
  • Posts: 57
Re: BillQuery Script Example
« Reply #2 on: July 26, 2014, 06:42:49 AM »
It was a long hard week, and I was not thinking right late in the day on a Friday.......

Attached is  PDF.  I tried to Limit the Pulling of bills to a "From" date.  At one time i tried a date range to limit the query.

The error I get I think is because of trying to pull too much data.

The error is:

The action cannot be completed because "" program is not responding.  Choose "Switch To" and correct the problem

If I enable the step to limit by means of a from date, the above error changes to a date format error (500).

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: BillQuery Script Example
« Reply #3 on: July 28, 2014, 07:59:49 AM »
Which version of FMP, QB, and FMBooks Connector are you using?

The first error message you report is one I haven't seen, but sounds a little like the "Server is busy..." message that the latest version of the plug-in seems to have fixed.

On the date format error: does your field contain a date value? Is the field a date-type field? Is the value in a valid date format?

Given a valid date value, the argument for $date_from should return a date in QB's expected date format. If your FMP file is formatted for US dates, using PCQB_SFormatString( Topper_Vendor_Bill2::Date_From ; "DATETYPE" ) will also format your date for QB.

Two other notes: TotalBalance is not an element of a Bill Response, so that will likely create an error once you get the date sorted out. And FullName and ListID will return once each for the Vendor, and again for every ExpenseLine and/or LineItem for Customer, Class, Item....

I expect you really want the TxnID and the AmountDue elements, based on the exit condition for your Loop and the steps that follow it.

If you continue to have trouble with the Date filter, evaluate PCQB_SGetXML( "Request" ; "" ) and post the result here.

HTH!

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

trebor

  • Member
  • *
  • Posts: 57
Re: BillQuery Script Example
« Reply #4 on: July 29, 2014, 02:59:03 PM »
Ok so I made some minor changes to the script and I ran it using a different version of QB and file.   I used the straight 2013 version on another file.  I pulled bill data from the fields I needed to!!!!! So I am making an assumption that the script works.

I open the file I need it to work on, run the same script, and BOMB. I get the error :

The action cannot be completed because "QuickBooks Account 2014 - [customer file name]" program is not responding.  Choose "Switch To" and correct the problem
- customer file name is placeholder for the real name.

There is another line after "problem" I cannot see and the dialog box cannot be resized.

Everything freezes up.  Filemaker, QB.

I am going to try and get another file to run in Accountant 2014 and see how things go. 

Again, some other scripts run fine, like pulling items (the script I used as a base for my BillQuery), but others don't that have run successfully in the past.

I am beginning to think it is a QB file problem, especially because I pulled the what I need from another file, albeit another version of QB as well.


Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: BillQuery Script Example
« Reply #5 on: July 30, 2014, 06:10:45 AM »
Make sure you're using the latest version of the plug-in, which was updated to resolve an issue that sounds very similar to what you describe.

HTH!

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

trebor

  • Member
  • *
  • Posts: 57
Re: BillQuery Script Example
« Reply #6 on: July 30, 2014, 07:02:28 AM »
I will get the latest plugin, and give it a go.

Also, last night I spoke to the accountant who gave me the file and he said "Oh we had a corruption and had to send out the  file to get it fixed" .  I wonder if it really got completely fixed?

When I get it all working I will post my script.   Will be a short bit though.