A trial version of QB Desktop needs to be installed so that you have something to develop against:
- Navigate to QB trial downloads
- QuickBooks Desktop trials for the United States (US) > QuickBooks Pro 2019 30-day trial (US only)
If you get a blank screen when first opening QB, do the following:
- End all instances of
QBW32.EXE
in task manager - Delete file
C:\ProgramData\Intuit\Entitlement Client\v8\EntitlementDataStore.ecml
- Reopen QB
The QB trial lasts 30 days. To "reactivate" it once it expires, do the above steps again.
The full QB Desktop SDK needs to be installed on your development machine. It comes with more than just the QBFC library, like documentation, example projects, etc.
- Navigate to QB SDK downloads
- Select Desktop SDK 13.0 Installer
In Visual Studio, add the QBFC library as a reference:
- Right-click References > Add Reference... > Browse... > COM > check qbFC13 1.0 Type Library > OK
QB SDK documentation can be found at C:\Program Files (x86)\Intuit\IDN\QBSDK13.0\doc\pdf
.
Example usage of SessionManager.cs
, Query.cs
, and Import.cs
:
// Open connection and begin session
SessionManager.Instance.OpenConnection();
SessionManager.Instance.BeginSession();
Console.WriteLine("Currently open QB filename: " + SessionManager.Instance.GetCurrentCompanyFileName());
// Query all employee names
Query query = new Query();
List<string> employeeNames = query.QueryEmployeeNames();
foreach (string name in employeeNames)
{
Console.WriteLine(name);
}
// Import a list of timeseets
Import import = new Import();
// This is just an empty list
// But let's assume you actually have a list of (custom) Timesheet objects
List<Timesheet> tmList = new List<Timesheet>();
import.ImportTimesheets(tmList);
// End session and close connection
SessionManager.Instance.EndSession();
SessionManager.Instance.CloseConnection();