Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 979 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi,

The project I'm currently working on is planning to switch to using multiple companies/QuickBooks Files from using a single QuickBooks files.  When I started the project,  I used/modified the scripts that came in the example file.  All of the scripts have a set of PCQB_BeginSession and PCQB_EndSession commands.  So the question is can I open the file once at the beginning of a loop and then close it at the end of the loop? 

Each script in the loop works with a different section of QuickBooks, ( Customers, Invoices, Vendor... ) either creating new records or modifying existing. 

Thanks for the help.

Bruce Herbach

Herbach Consulting

 

Posted

It should be possible, assuming you'll update your PCQB_BeginSession steps to conditionally identify the relevant QB Company file with a path that works for all who would be running it, and none of those users will have any QB Company file open when it runs.

Know that it's very likely to slow your script completion significantly, since you'll be waiting on QB to launch every time you call PCQB_BeginSession. Batch processing and "On Timer" scripts make it less onerous, but not pain free.

Also worth noting that a "headless connection" using the file path has, in the past, been troublesome for many users. Don't know whether it's a plug-in thing or more of a WindowsOS/Registry/QBApp thing, but I've long recommended having users launch the QB Company file manually before running all processes relevant to that file.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated

14000 Creekside Drive
Matthews, NC 28105
704.814.6852

Posted

Good Morning Geoffrey,

So the key question here is, does each use of PCQB_RqExecute require it's own set of PCQB_BeginSession, PCQB_EndSession?  Or can I have a single PCQB_BeginSession followed by several sub scripts that have a PCQB_Execute step followed by a single PCQB_EndSession?

Thanks

Bruce Herbach

 

Posted

It does not, but that presupposes you're tracking which QB Company file was last opened and whether the current PCQB_RqExecute command should be operating within the currently open file. Ideally, your workflow would have you cycling through all the work for a single QB Company file, then closing it and opening the next one as your user processes FMP records relevant to that company.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC 28105
704.814.6852

  • Like 1
Posted

Geoffrey,

Thanks very much.  I'm setting this up to track and control which QB Company file is being used as you have described.

Regards

Bruce Herbach

Posted

One further note on this: QB Enterprise allows simultaneous access to two Company files via the UI. I haven't done significant testing, but my limited experience with QB Enterprise and two open Company files suggests that it's difficult (perhaps impossible) to ensure all API calls target the intended file. You'll likely want to make sure your users do not open a second Company file while using the API.

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC 28105
704.814.6852

This topic is 979 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.