Reputation: 5084
I am creating a C# application to integrate with Quickbooks for one of my company's clients using SDK 13.0. The problem is, Quickbooks versions/editions are very different. Quickbooks Pro items do not use a "Unit of Measure" as Quickbooks Premier items do use a Unit of Measure. If I include Unit of Measure when adding an item to Quickbooks Pro, it throws an error and vice versa. Is there any way to detect and return the user's version of Quickbooks using the session object so that I can turn the Unit of Measure feature off and on with my code? I have gone through the SDK, Technical Overview, and the Onscreen Reference and cannot find anything.
Upvotes: 0
Views: 52
Reputation: 1319
There's not a direct way to query what 'level' of QuickBooks you are using. The recommended way would be to perform a PreferencesQuery first and parse the results to see if a feature is enabled. For your example of Unit Of Measure, even if they have the Enterprise edition, they may not have enabled it and you can get errors if you tried to use it. Unfortunately, that preference isn't included in the PreferencesQuery. The workaround that I've done is try to Query the Unit Of Measure and catch any COMException. You'll typically get a 'This request is not supported by this implementation.' error if the version doesn't support a feature or it isn't enabled.
The On Screen Reference (https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html) gives sample code for most of the queries for both C# and VB.
Upvotes: 1