Author Topic: PCQB_EndSession -- bug in FMBooks 9?  (Read 1144 times)

db

  • Member
  • *
  • Posts: 11
PCQB_EndSession -- bug in FMBooks 9?
« on: October 07, 2016, 10:57:08 AM »
Hi,

Based on the sample files that came with v8, and my own experiences working with the FMbooks connector, I have the subscript that opens a new session call  *PCQB_EndSession* immediately before calling PCQB_BeginSession just in case a session had inadvertently not been closed properly.

With the recent upgrade to Fmbooks 9, however, calling PCQB_EndSession when a session is not open results in a "?"; which is triggering the error checks that it is wrapped in; because it is supposed to return "0 for success or !!ERROR!!" its not ever supposed to return "?".

The PCQB_SGetStatus that it logs is "CODE: 0 SEVERITY: Success MESSAGE: Success.

So the question is why is it now returning "?" on a successful call? Is this a bug?

That said, is there a better/best practice for checking for and closing an open session rather than simply calling EndSession first?

(I've taken quite a bit of care to handle errors gracefully; so sessions are almost never left dangling in finished code, but sessions do occasionally get left open especially while I'm developing new scripts -- so the overhead of the end session call at the start of each session handles that cleanly.)

Chris Turner

  • Administrator
  • Member
  • *****
  • Posts: 28
    • Productive Computing, Inc.
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #1 on: October 07, 2016, 11:13:36 AM »
Hi db,

I've downloaded and installed a fresh copy of the FM Books Connector v9 and ran a test of starting up FileMaker and then calling PCQB_EndSession. I received a result of "0", and not "?".

Have you tried reinstalling the FM Books Connector plug-in? Did you also ensure that the QB Bridge additional software was installed along with it?

Thanks!

Chris Turner
Product Support Specialist
Chris Turner
Product Support Specialist
Productive Computing, Inc.

db

  • Member
  • *
  • Posts: 11
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #2 on: October 07, 2016, 11:29:07 AM »
I was just about to followup and edit my post. I think FMbooks itself must have crashed, because shortly after posting that message; PCQB_BeginSession started throwing an !Error! too; "CODE -2147417851"; and something about 'server threw an exception'. (Unfortunately I logged off windows, losing the notepad I'd pasted the full exception message into)  Quickbooks wouldn't close saying FMBooks was still using it. I tried running EndSession and it 'succeeded' with a "?" but still couldn't close quickbooks. So I closed Filemaker -- and it crashed while closing. And then quickbooks still wouldn't close. So I logged off and forced QB to close.

When I logged back in and brought it all back up; I am now getting a '0' on PCQB_EndSession; and it seems to all be working normally again.

If it starts to flake out again I'll try to post more information.

"Have you tried reinstalling the FM Books Connector plug-in? Did you also ensure that the QB Bridge additional software was installed along with it?"

I used the installer; and was successfully opening and closing sessions and pushing/pulling data. So I assume everything is installed correctly.


Chris Turner

  • Administrator
  • Member
  • *****
  • Posts: 28
    • Productive Computing, Inc.
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #3 on: October 07, 2016, 12:00:53 PM »
Hi db,

Very peculiar... We'll run some additional tests on this in the interim, see if there is something else that might be causing the problem.

One final question: Were you using FileMaker 64-bit, or FileMaker 32-bit, when you had the issue? That also might shed a little more light on this.

Thanks!
Chris Turner
Product Support Specialist
Productive Computing, Inc.

db

  • Member
  • *
  • Posts: 11
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #4 on: October 07, 2016, 12:04:47 PM »
Well that didn't take long...

End session returns:

result: ?
CODE: 0
SEVERITY: Success
MESSAGE: Success

Begin Session returns:
result: !!ERROR!!
CODE: -2147417851
SEVERITY: Exception
MESSAGE: Message:The server threw an exception.Source:(null)Desc:(null)

Just moments ago it was working fine. I'm not sure what to make of it. Any suggestions welcome!

To answer your question...
Filemaker Advanced 15 64-bit; on server 2012 R2; against Quickbooks Pro 2015 (Canada)

**Edit** Quickbooks Pro 2016 Canada


« Last Edit: October 07, 2016, 12:23:38 PM by db »

trebor

  • Member
  • *
  • Posts: 57
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #5 on: October 13, 2016, 06:27:49 PM »
I am getting the Exact same error.

MESSAGE: Message:The server threw an exception.

It happens at all different places along my scripts.  Even got it when it was just testing the connection in the using Demo file. 

At one pint the demo said the plugin was not installed, after working with it for about an hour after getting this error.

Quit everything and it came around after clicking register again.

At one point could not even start filemaker. Had to restart machine.



Not the only problem with I am having......

Will post a fresh Q.


trebor

  • Member
  • *
  • Posts: 57
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #6 on: October 14, 2016, 08:55:04 AM »
Got this from the demo when trying to connect to the QB file.  This is after I have been using it for a while (working on an invoice items problem).

Error Connecting to QuickBooks Company file:
CODE: -2147417851
SEVERITY: Exception
MESSAGE: Message:The server threw an exception.Source:(null)Des(null)
Please make sure that "Windows User Account Control is enabled.

Cannot shut down QuickBooks either, it is as if the plugin wont let it go.  Have to TaskManger and force it to end the task.  Even after running a close session and close connection scripts.  Wont let it go.

UPDATE: This seems to happen every time I stop a script in the middle of executing.  I am running the debugger in Advanced and get to a point where I abort the script (see a problem to fix an do so), then it gives me the above error when i try to re-run the script.  This is happening consistently.

To fix it I Quit Filemaker and restart my solution. Then Launch the Demo file, re-register the plugin and then hit the "Test" button.  It then works fine.  However I still cannot close QuickBooks.
« Last Edit: October 14, 2016, 10:08:19 AM by trebor »

Admin

  • Administrator
  • Member
  • *****
  • Posts: 201
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #7 on: October 14, 2016, 04:56:12 PM »
We are currently investigating the issue, however, to get a more accurate replication of the occurrence, could you please provide more information about your machine's environment:

  • Is the QuickBooks user account an admin account or does it have restricted access?
  • Did you establish a brand new connection certificate or are you using a previously existing certificate?
  • What type of data were you trying to transfer?

db

  • Member
  • *
  • Posts: 11
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #8 on: October 19, 2016, 01:27:12 PM »
- I'm using the QB admin account.
- I established a new certificate.
- Type of data? (didn't seem to matter); when I ran tests to trigger it; I was pushing customer accounts from filemaker to quickbooks.

jSanders

  • Member
  • *
  • Posts: 20
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #9 on: October 23, 2016, 06:24:26 PM »
Same issue here.

-j

ForeSight IS

  • Member
  • *
  • Posts: 2
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #10 on: August 29, 2017, 02:40:17 PM »
I realize this is an old post but I am having the same issue and don't see that there was ever a solution found, I'm hoping in the past year someone has figure this out???

I have written a script that creates invoices in QB Pro 2016, it takes a set of records that contain the data for invoice line items for multiple clients sorted by the clients QB ID number and creates an invoice for each client. Almost every time I run the script it will process around 40 items (slowly) and then stop producing the error below, I can restart it and it will run at a faster pace and finish the remaining 50 or more items without error. It Usually skips a client (skipping 2 to 30 items all for the same client) when it fails but if I include those missed items in the remaining records it will process them the second time without error. It has run through the items without stopping and there are always between 80 and 120 (roughly) invoice items to be processed. It never produces the error twice in a row but I do need to reboot the machine to get it to close out QB and allow my bookkeeper to login to QB if it stops even after running it again and finishing the unprocessed items.

I am running FM Pro 15 with V9 plug-in but it started when I was running FM 14 with V8 plug-in.

Thanks in advance!!

ForeSight IS

  • Member
  • *
  • Posts: 2
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #11 on: August 29, 2017, 02:42:31 PM »
I forgot to post the error...

Error Connecting to QuickBooks Company file:
CODE: -2147417851
SEVERITY: Exception
MESSAGE: Message:The server threw an exception.Source:(null)Desc:(null)

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: PCQB_EndSession -- bug in FMBooks 9?
« Reply #12 on: August 30, 2017, 10:19:46 AM »
I am running FM Pro 15 with V9 plug-in but it started when I was running FM 14 with V8 plug-in.

Are you running the 32-bit or 64-bit version of FMP and plug-in?

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