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.
-
what language are you using. Are you integrated with their SDK? – Sorceri Mar 28 '18 at 16:19
-
Yes. I am using C# with SDK 13.0 – Rani Radcliff Mar 28 '18 at 16:20
-
Did you look here [link](https://developer.intuit.com/docs/0200_quickbooks_desktop/0400_tools/quickbooks_desktop/sample_code) as there are multiple examples that show querying to get the version. – Sorceri Mar 28 '18 at 16:25
-
I have been to that page multiple times. I could not and still cannot locate anything that gets the user's Quickbooks verion. I see where you can get the SDK version supported. If I am missing something. Can you be more specific about what you are referring? – Rani Radcliff Mar 28 '18 at 16:27
-
do a search on the page for the key word determine or version. Then you just need to look at the code samples. The samples are in VB but should be able to convert to C#. – Sorceri Mar 28 '18 at 16:38
-
I am familiar with VB, but none of the samples you are suggesting get what I am trying to get. The only thing any of that code returns is the supported SDK version, or the whether they have the US or UK version of Quickbooks. I need to know whether they are using Pro, Premier, etc. – Rani Radcliff Mar 28 '18 at 16:50
-
I don't have time to jump through their examples but there should be a major and minor version that indicates the product. On the other hand, you can also use WMI to query for installed software and see if it is in the list. https://stackoverflow.com/questions/673233/wmi-installed-query-different-from-add-remove-programs-list – Sorceri Mar 28 '18 at 19:53
1 Answers
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.

- 1,309
- 1
- 8
- 11