QuickBooks Integrator 2020 Node.js Edition

Questions / Feedback?

OpenQBConnection Method

Opens a persistent connection to QuickBooks.

Syntax

itemreceipt.openQBConnection([callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

Invoking OpenQBConnection will open a persistent connection to QuickBooks. After invoking OpenQBConnection, all requests such as Get, Add, etc. will use the established connection until CloseQBConnection is invoked.

The effect of OpenQBConnection is to increase performance. If OpenQBConnection is not invoked, a connection to QuickBooks will automatically be created and destroyed each time the class communicates with QuickBooks. Using OpenQBConnection will be faster, particularly in the case of automatic login.

After OpenQBConnection is invoked, QuickBooks will issue a connection ticket, and it will be stored in QBConnectionString. When CloseQBConnection is invoked the ticket will be invalidated, and any further attempts to use it will fail.

Be sure to invoke CloseQBConnection when you have finished communicating with QuickBooks. Leaving an open QuickBooks connection may lock out other integrated applications, affect QuickBooks performance, or cause other problems.

Copyright (c) 2021 /n software inc. - All rights reserved.
QuickBooks Integrator 2020 Node.js Edition - Version 20.0 [Build 7941]