Plug-ins > FM Books Connector

FileMaker hangs or crashes

(1/2) > >>

Melinda DePalma:
Sometimes processing a request may take a while to complete and if the user clicks anywhere on FileMaker during processing, then FileMaker can hang or crash.

This is actually a known FileMaker issue rather than a plug-in bug.When a plug-in waits for data from a 3rd party application and a user clicks on FileMaker, then FileMaker can sometimes hang causing the issue you are described.

In order to resolve the issue we have actually added a parameter that can be set in the script when the FM Books Connector plug-in executes a query in QuickBooks to hide FileMaker and present the attached dialog.

If the “optHideFMWindow” parameter is set to “Y” in the PCQB_BeginSession and PCQB_RqExecute functions, then the FileMaker Pro window is hidden from the user until the function returns. The attached dialog is displayed in its place. This should be used when execution takes longer than 2 seconds.

To further elaborate the idea of temporarily “hiding” FileMaker completely eliminates the problem. This is done in order to stabilize FileMaker, keep the user from selecting FileMaker and keep FileMaker from hanging during large QuickBooks queries. Hiding FileMaker is necessary because of the environment between the plug-in and FileMaker. Hiding FileMaker is not necessary for most queries – just the ones that take more than a few seconds to execute like as is the case when importing Customers, Invoices or Payments. The dialog will only display during the actual QuickBooks query and not during the FileMaker import.

The PCQB_BeginSession and PCQB_RqExecute functions are further explained in the Functions Guide.

I have found connection times can vary from 1 second to 44 seconds when doing something as simple as testing the connection using Begin and EndSession.  If QB is up and running, the connection time can be short.  If QB is closed and FileMaker opens file first, that first connection can take a while.  Is there a way to know if QB is running?  And if not, should I use the optHideFMWindow parameter by default?

Melinda DePalma:
Yes, the connection times can vary depending on if QBs is open or not. If QBs is closed, then when you call BeginSession the QBs process must be started to launch the QBs program in the background which can vary depending on the machine. Open QBs without using the plug-in and time how long it takes to load QBs. This will give you an idea of how long it will take to BeginSession using the plug-in with QBs closed.

Unfortunately you cannot check to see if QuickBooks is opened using the plug-in.

You can always use the optHideFMWindow by default, but please be aware that the window will not reappear until EndSession is called. Best practices are to always call BeginSession, Execute, and EndSession together. As long as you follow these practices and always end your session then you are fine to use the optHideFMWindow by default.

Is there a way to use Script Debugger while optHideFMWindow is in use, or will I get stuck?

For example when proofing a script like this:
Set Variable [ $QB_Result ; PCQB_BeginSession ]
Set Field [ FileVersion ; PCQB_GetCurrentFileVersion ]
Set Field [ FileName ; PCQB_GetCurrentFileName ]
Set Variable [ $QB_Result ; PCQB_EndSession ]

Melinda DePalma:
You will get stuck if using Script Debugger with the optHideFMWindow parameter in your script steps below. Instead put the function calls above into a single script step as shown below.

Set Variable [ $QB_Result ; PCQB_BeginSession & "|" & PCQB_GetCurrentFileVersion & "|" & PCQB_GetCurrentFileName & "|" & PCQB_EndSession ]

Then you can parse $QB_Result for the desired values.


[0] Message Index

[#] Next page

Go to full version