PreferencesQuery(1.1)

A PreferencesQueryRq request message returns information about many of the preferences that the QuickBooks user has set in the company file. Preferences cannot be modified through the SDK, only through the QuickBooks user interface. Note: If you include an explicit end tag in a PreferencesQueryRq request, you will receive an error if there is any space between the opening tag and the end tag. The following table shows valid and invalid ways of constructing this request:

Valid
(no space between opening and closing tags)
Valid

(combined opening and closing tag)
Invalid
(space between opening and closing tags)

Request

Response

XMLOps

VB.NET

C#

Tag Type Max length Implementation Required

IPreferencesQuery

A PreferencesQueryRq request message returns information about many of the preferences that the QuickBooks user has set in the company file. Preferences cannot be modified through the SDK, only through the QuickBooks user interface. Note: If you include an explicit end tag in a PreferencesQueryRq request, you will receive an error if there is any space between the opening tag and the end tag. The following table shows valid and invalid ways of constructing this request:Valid(no space between opening and closing tags) Valid(combined opening and closing tag) Invalid (space between opening and closing tags)
    1.1  

IncludeRetElementList

You use this if you want to limit the data that will be returned in the response. In this list, you specify the name of each top-level element or aggregate that you want to be returned in the response to the request. You cannot specify fields within an aggregate, for example, you cannot specify a City within an Address: you must specify Address and will get the entire address. The names specified in the list are not parsed, so you must be especially careful to supply valid names, properly cased. No error is returned in the status code if you specify an invalid name. Notice that if you want to return custom data or private data extensions, you must specify the DataExtRet element and you must supply the OwnerID set to either a value of 0 (custom data) or the GUID for the private data.
IBSTRList 50 chars 4.0  
Tag Type Max length Implementation Required

IResponse

A PreferencesQueryRq request message returns information about many of the preferences that the QuickBooks user has set in the company file. Preferences cannot be modified through the SDK, only through the QuickBooks user interface. Note: If you include an explicit end tag in a PreferencesQueryRq request, you will receive an error if there is any space between the opening tag and the end tag. The following table shows valid and invalid ways of constructing this request:Valid(no space between opening and closing tags) Valid(combined opening and closing tag) Invalid (space between opening and closing tags)
    1.1  

StatusCode

A number that corresponds to a statusSeverity and statusMessage. Five status codes relate directly to signon messages: 2000, 2010, 2020, 2030, and 2040. For details about these and other statusCode values that can be returned, see the statusCode table on the Error Codes page.
IQBIntType     Y

StatusSeverity

One of the following values: INFO The request was completed, and the results are consistent with what your application expected. WARNING The request was completed, but the results might not be consistent with what you expected. ERROR The request was not completed. No data will appear in the server’s response after the statusMessage.
IQBStringType     Y

StatusMessage

A user-readable explanation of the success or error condition that is indicated by the statusCode. For details about the statusMessage values that can be returned, see the “Explanation” column of the statusCode table on the Error Codes page.
IQBStringType     Y

Detail

IPreferencesRet      

AccountingPreferences

Accounting preferences that the QuickBooks administrator has set. These preferences apply to all users who log into this QuickBooks company file.
IAccountingPreferences     Y

IsUsingAccountNumbers

If true, an account number can be recorded for new accounts. If you include an account number in AccountAdd object when this preference is false, the account number will still be set, but will not be visible in the user interface.
IQBBoolType     Y

IsRequiringAccounts

If IsRequiringAccounts is true, a transaction cannot be recorded in the user interface unless it is assigned to an account. (However, transactions affected by this preference always require an account to be specified when added through the SDK.)
IQBBoolType     Y

IsUsingClassTracking

If true, QuickBooks will include a “Class” field on all transactions.
IQBBoolType     Y

AssignClassesTo

Default class assigned to transactions.
IQBENAssignClassesToType   12.0  

IsUsingAuditTrail

If true, QuickBooks will log all transaction changes in the audit trail report. If false, QuickBooks logs only the most recent version of each transaction.
IQBBoolType     Y

IsAssigningJournalEntryNumbers

If true, QuickBooks will automatically assign a number to each journal entry.
IQBBoolType     Y

ClosingDate

The company closing date set within the company file. (The QuickBooks Admin can assign a password restricting access to transactions that occurred before this date.)
IQBDateType      

FinanceChargePreferences

Preferences that the QuickBooks administrator has set for how finance charges are assessed against customers for late payment. These preferences apply to all users who log into this QuickBooks company file.
IFinanceChargePreferences     Y

AnnualInterestRate

The interest rate, set by the QuickBooks user, that QuickBooks will use to calculate finance charges. The default value is 0.
IQBPercentType      

MinFinanceCharge

The minimum finance charge that will be applied regardless of the amount overdue. MinFinanceCharge is set by the QuickBooks user, and has a default value (within QuickBooks) of 0.
IQBAmountType      

GracePeriod

The number of days before finance charges apply to customers’ overdue invoices. GracePeriod is set by the QuickBooks user, and has a default value (within QuickBooks) of 0.
IQBIntType     Y

FinanceChargeAccountRef

Refers to the name of the account used to track finance charges that customers pay. This is usually an income account. In a request, if a FinanceChargeAccountRef aggregate includes both FullName and ListID, FullName will be ignored.
IQBBaseRef      

ListID

Along with FullName, ListID is a way to identify a list object. When a list object is added to QuickBooks through the SDK or through the QuickBooks user interface, the server assigns it a ListID. A ListID is not unique across lists, but it is unique across each particular type of list. For example, two customers could not have the same ListID, and a customer could not have the same ListID as an employee (because Customer and Employee are both name lists). But a customer could have the same ListID as a non-inventory item.
IQBIDType      

FullName

FullName (along with ListID) is a way to identify a list object. The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.
IQBStringType 159 chars    

IsAssessingForOverdueCharges

If true, finance charges are assessed on overdue finance charges. This preference is set by the QuickBooks user, and has a default value (within QuickBooks) of false. (Note that laws vary about whether a company can charge interest on overdue interest payments.)
IQBBoolType     Y

CalculateChargesFrom

This preference is set by the QuickBooks user. Unless they change the value within QuickBooks, it will be DueDate.
IQBENCalculateChargesFromType     Y

IsMarkedToBePrinted

If IsMarkedToBePrinted is true, all newly created finance-charge invoices will be marked “To be printed.” (This makes it easier for the QuickBooks user to print a selection of invoices all at once.) This preference is set by the QuickBooks user, and has a default value within QuickBooks of false.Whether IsMarkedToBePrinted is true or false in the FinanceChargePreferences aggregate, the QuickBooks user can still change this preference for each individual invoice.
IQBBoolType     Y

JobsAndEstimatesPreferences

Preferences that the QuickBooks administrator has set about how to handle jobs and estimates. These preferences apply to all users who log into this QuickBooks company file.
IJobsAndEstimatesPreferences     Y

IsUsingEstimates

If true, this user is set up to create estimates for jobs.
IQBBoolType     Y

IsUsingProgressInvoicing

If true, the QuickBooks user can create an invoice for only a portion of an estimate.
IQBBoolType     Y

IsPrintingItemsWithZeroAmounts

If true, line items with zero amounts will print on progress invoices. (IsPrintingItemsWithZeroAmounts is not relevant unless IsUsingProgressInvoices is true.)
IQBBoolType     Y

MultiCurrencyPreferences

This aggregate contains the current multi currency settings for this company file.
IMultiCurrencyPreferences   8.0  

IsMultiCurrencyOn

Indicates whether the multicurrency feature is turned on for this company file. A value of true means it is turned on, a value of false means it is not turned on. Currently, once multicurrency is turned on for a company file, it cannot be turned off.
IQBBoolType      

HomeCurrencyRef

The currency that is set as the home currency for this company file. The home currency is normally the currency of the country where the business is physically located. Although a home currency other than US Dollars can be chosen for the home currency, certain QuickBooks convenience features are available only with a home currency of US Dollars, such as the ability to download via a button click in the UI the current exchange rates for all active currencies, which is supported only for home currency of USD–otherwise you’ll have to look up and add the exchange rates yourself. Also, Intuit services such as payroll and online banking will not be available as these services are only available in US dollars. Currently, once the home currency has been set and used in any transaction, it cannot be changed.
IQBBaseRef      

ListID

Along with FullName, ListID is a way to identify a list object. When a list object is added to QuickBooks through the SDK or through the QuickBooks user interface, the server assigns it a ListID. A ListID is not unique across lists, but it is unique across each particular type of list. For example, two customers could not have the same ListID, and a customer could not have the same ListID as an employee (because Customer and Employee are both name lists). But a customer could have the same ListID as a non-inventory item.
IQBIDType      

FullName

FullName (along with ListID) is a way to identify a list object. The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.
IQBStringType 64 chars    

MultiLocationInventoryPreferences

This aggregate contains the current multilocation inventory settings for this company file.
IMultiLocationInventoryPreferences   10.0 us.png  

IsMultiLocationInventoryAvailable

Indicates whether the multilocation inventory feature is available for this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType      

IsMultiLocationInventoryEnabled

Indicates whether the multilocation inventory feature is turned on for this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType      

PurchasesAndVendorsPreferences

Preferences that the QuickBooks administrator has set about how to handle purchases and vendors. These preferences apply to all users who log into this QuickBooks company file.
IPurchasesAndVendorsPreferences     Y

IsUsingInventory

If IsUsingInventory is true, the inventory-related features of QuickBooks are available.
IQBBoolType     Y

DaysBillsAreDue

By default, bills are due this many days after receipt.
IQBIntType     Y

IsAutomaticallyUsingDiscounts

If true, QuickBooks will automatically apply available vendor discounts or credits to a bill that is being paid.
IQBBoolType     Y

DefaultDiscountAccountRef

Refers to the account where vendor discounts are tracked. In a request, if a DefaultDiscountAccountRef aggregate includes both FullName and ListID, FullName will be ignored.
IQBBaseRef      

ListID

Along with FullName, ListID is a way to identify a list object. When a list object is added to QuickBooks through the SDK or through the QuickBooks user interface, the server assigns it a ListID. A ListID is not unique across lists, but it is unique across each particular type of list. For example, two customers could not have the same ListID, and a customer could not have the same ListID as an employee (because Customer and Employee are both name lists). But a customer could have the same ListID as a non-inventory item.
IQBIDType      

FullName

FullName (along with ListID) is a way to identify a list object. The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.
IQBStringType 159 chars    

ReportsPreferences

Reporting preferences that the QuickBooks administrator has set. The preferences returned through the SDK apply to all users who log into this QuickBooks company file.
IReportsPreferences     Y

AgingReportBasis

“AgeFromDueDate” means that the overdue days shown in these reports will begin with the due date on the invoice. “AgeFromTransactionDate” means that the overdue days shown in these reports will begin with the date the transaction was created.
IQBENAgingReportBasisType     Y

SummaryReportBasis

Indicates whether summary reports use cash-basis or accrual-basis bookkeeping.
IQBENSummaryReportBasisType     Y

SalesAndCustomersPreferences

Sales and customer preferences that the QuickBooks administrator has set. These preferences apply to all users who log into this QuickBooks company file.
ISalesAndCustomersPreferences     Y

DefaultShipMethodRef

Will be used as the default value in all “Ship Via” fields. (Refers to an item on the ShipMethod list.) If a DefaultShipMethodRef aggregate includes both FullName and ListID, FullName will be ignored.
IQBBaseRef      

ListID

Along with FullName, ListID is a way to identify a list object. When a list object is added to QuickBooks through the SDK or through the QuickBooks user interface, the server assigns it a ListID. A ListID is not unique across lists, but it is unique across each particular type of list. For example, two customers could not have the same ListID, and a customer could not have the same ListID as an employee (because Customer and Employee are both name lists). But a customer could have the same ListID as a non-inventory item.
IQBIDType      

FullName

FullName (along with ListID) is a way to identify a list object. The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.
IQBStringType 15 chars    

DefaultFOB

Default FOB (site from which invoiced products are shipped).
IQBStringType 13 chars    

DefaultMarkup

Default percentage that an inventory item will be marked up from its cost.
IQBPercentType      

IsTrackingReimbursedExpensesAsIncome

If true, an expense and the customer’s reiumbursement for that expense can be tracked in separate accounts.
IQBBoolType     Y

IsAutoApplyingPayments

If true, a customer’s payment will automatically be applied to the outstanding invoices for that customer, beginning with the oldest invoice.
IQBBoolType     Y

PriceLevels

You can use price levels to specify custom pricing for specific customers. Once you create a price level for a customer, QuickBooks will automatically use the custom price in new invoices, sales receipts, sales orders or credit memos for that customer. You can override this automatic feature, however, when you create the invoices, sales receipts, etc.) The user can now specify a price level on line items in the following supported sales transaction: invoices, sales receipts, credit memos, and sales orders.
IPriceLevels   4.0  

IsUsingPriceLevels

If true, price levels have been turned on for the company file (under Sales and Customers preferences), which enables the creation and use of price levels.
IQBBoolType     Y

IsRoundingSalesPriceUp

If true, amounts are rounded up to nearest whole dollar for fixed percentage price levels (not for per item price levels).
IQBBoolType      

SalesTaxPreferences

Sales-tax preferences that the QuickBooks administrator has set. These preferences apply to all users who log into this QuickBooks company file. If sales tax is turned off in the user interface (that is, if “No” is selected for “Do You Charge Sales Tax?” in the sales tax preferences), then a PreferencesQuery message will not return this aggregate at all.
ISalesTaxPreferences      

DefaultItemSalesTaxRef

The default tax code for sales. (Refers to a sales-tax code on the SalesTaxCode list.) In a request, if a DefaultItemSalesTaxRef aggregate includes both FullName and ListID, FullName will be ignored.
IQBBaseRef     Y

ListID

Along with FullName, ListID is a way to identify a list object. When a list object is added to QuickBooks through the SDK or through the QuickBooks user interface, the server assigns it a ListID. A ListID is not unique across lists, but it is unique across each particular type of list. For example, two customers could not have the same ListID, and a customer could not have the same ListID as an employee (because Customer and Employee are both name lists). But a customer could have the same ListID as a non-inventory item.
IQBIDType      

FullName

FullName (along with ListID) is a way to identify a list object. The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.
IQBStringType 31 chars    

PaySalesTax

The frequency of sales tax reports.
IQBENPaySalesTaxType     Y

DefaultTaxableSalesTaxCodeRef

The default tax code for taxable sales. (Refers to a sales-tax code on the SalesTaxCode list.) In a request, if a DefaultTaxableSalesTaxCodeRef aggregate includes both FullName and ListID, FullName will be ignored.
IQBBaseRef     Y

ListID

Along with FullName, ListID is a way to identify a list object. When a list object is added to QuickBooks through the SDK or through the QuickBooks user interface, the server assigns it a ListID. A ListID is not unique across lists, but it is unique across each particular type of list. For example, two customers could not have the same ListID, and a customer could not have the same ListID as an employee (because Customer and Employee are both name lists). But a customer could have the same ListID as a non-inventory item.
IQBIDType      

FullName

FullName (along with ListID) is a way to identify a list object. The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.
IQBStringType 3 chars    

DefaultNonTaxableSalesTaxCodeRef

The default tax code for non-taxable sales. (Refers to a sales-tax code on the SalesTaxCode list.) If a DefaultNonTaxableSalesTaxCodeRef aggregate includes both FullName and ListID, FullName will be ignored.
IQBBaseRef     Y

ListID

Along with FullName, ListID is a way to identify a list object. When a list object is added to QuickBooks through the SDK or through the QuickBooks user interface, the server assigns it a ListID. A ListID is not unique across lists, but it is unique across each particular type of list. For example, two customers could not have the same ListID, and a customer could not have the same ListID as an employee (because Customer and Employee are both name lists). But a customer could have the same ListID as a non-inventory item.
IQBIDType      

FullName

FullName (along with ListID) is a way to identify a list object. The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.
IQBStringType 3 chars    

IsUsingVendorTaxCode

Indicator whether the Use Vendor Tax Codes is turned on for vendors in this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType      

IsUsingCustomerTaxCode

Indicator whether the Use Customer Tax Codes is turned on for customers in this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType      

IsUsingAmountsIncludeTax

Indicator whether the Allow tax inclusive prices is turned on for this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType      

TimeTrackingPreferences

Time-tracking preferences that the QuickBooks administrator has set. If time tracking is turned off in the user interface (that is, if “No” is selected for “Do You Track Time?” in the time tracking preferences), then a PreferencesQuery message will not return this aggregate at all.
ITimeTrackingPreferences      

FirstDayOfWeek

The first day of a weekly timesheet period.
IQBENFirstDayOfWeekType     Y

CurrentAppAccessRights

CurrentAppAccessRights indicates whether auto-login has been allowed, the name of the auto-login user, and whether the application has been granted access to personal (sensitive) data.
ICurrentAppAccessRights     Y

IsAutomaticLoginAllowed

If IsAutomaticLoginAllowed is true, then applications can use auto-login to access this QuickBooks company file.
IQBBoolType     Y

AutomaticLoginUserName

If auto-login is allowed for this QuickBooks company file, AutomaticLoginUserName gives the user name that is allowed to use auto-login.
IQBStringType 29 chars    

IsPersonalDataAccessAllowed

If true, then access is allowed to personal (sensitive) data in this QuickBooks company file.
IQBBoolType     Y

ItemsAndInventoryPreferences

This aggregate contains the current item inventory settings for this company file.
IItemsAndInventoryPreferences   11.0  

EnhancedInventoryReceivingEnabled

Indicator whether the enanched inventory receiving is turned on for this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType      

IsTrackingSerialOrLotNumber

Indicator on whether the serial or lot number tracking is being tracked for this company file. IsTrackingSerialOrLotNumber may have one of the following values: None [DEFAULT], SerialNumber, LotNumber
IQBENIsTrackingSerialOrLotNumberType      

IsInventoryExpirationDateEnabled

This lets you know if expiration date of the inventory serial/lot number is enabled/disabled in your company file. Expiration Date is supported from QB Desktop 2023 version 3 (USA & Canada) and SDK 16.0.
IQBBoolType   16.0 CA.png us.png  

isTrackingOnSalesTransactionsEnabled

Indicator whether the serial or lot number tracking is turned on for sales transactions in this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType      

isTrackingOnPurchaseTransactionsEnabled

Indicator whether the serial or lot number tracking is turned on for purchase transactions in this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType      

isTrackingOnInventoryAdjustmentEnabled

Indicator whether the serial or lot number tracking is turned on for inventory adjustments in this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType      

isTrackingOnBuildAssemblyEnabled

Indicator whether the serial or lot number tracking is turned on for build assemblies in this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType      

FIFOEnabled

Indicator whether FIFO (First In, First Out) to calculate the value of inventory sold and on-hand is turned on for this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType      

FIFOEffectiveDate

Date that FIFO (First In, First Out) is used to calculate the value of inventory sold and on-hand for this company file.
IQBDateType      

IsRSBEnabled

Indicator whether the bin tracking is turned on for this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType   12.0  

IsBarcodeEnabled

Indicator whether barcode are enabled for this company file. A value of true means it is turned on, a value of false means it is not turned on.
IQBBoolType   12.0  

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="16.0"?>
<QBXML>
        <QBXMLMsgsRq onError="stopOnError">
                <PreferencesQueryRq>
                        <IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat -->
                </PreferencesQueryRq>

                <PreferencesQueryRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE">
                        <PreferencesRet> <!-- optional -->
                                <AccountingPreferences> <!-- required -->
                                        <IsUsingAccountNumbers >BOOLTYPE</IsUsingAccountNumbers> <!-- required -->
                                        <IsRequiringAccounts >BOOLTYPE</IsRequiringAccounts> <!-- required -->
                                        <IsUsingClassTracking >BOOLTYPE</IsUsingClassTracking> <!-- required -->
                                        <!-- AssignClassesTo may have one of the following values: None [DEFAULT], Accounts, Items, Names -->
                                        <AssignClassesTo >ENUMTYPE</AssignClassesTo> <!-- optional -->
                                        <IsUsingAuditTrail >BOOLTYPE</IsUsingAuditTrail> <!-- required -->
                                        <IsAssigningJournalEntryNumbers >BOOLTYPE</IsAssigningJournalEntryNumbers> <!-- required -->
                                        <ClosingDate >DATETYPE</ClosingDate> <!-- optional -->
                                </AccountingPreferences>
                                <FinanceChargePreferences> <!-- required -->
                                        <AnnualInterestRate >PERCENTTYPE</AnnualInterestRate> <!-- optional -->
                                        <MinFinanceCharge >AMTTYPE</MinFinanceCharge> <!-- optional -->
                                        <GracePeriod >INTTYPE</GracePeriod> <!-- required -->
                                        <FinanceChargeAccountRef> <!-- optional -->
                                                <ListID >IDTYPE</ListID> <!-- optional -->
                                                <FullName >STRTYPE</FullName> <!-- optional -->
                                        </FinanceChargeAccountRef>
                                        <IsAssessingForOverdueCharges >BOOLTYPE</IsAssessingForOverdueCharges> <!-- required -->
                                        <!-- CalculateChargesFrom may have one of the following values: DueDate, InvoiceOrBilledDate -->
                                        <CalculateChargesFrom >ENUMTYPE</CalculateChargesFrom> <!-- required -->
                                        <IsMarkedToBePrinted >BOOLTYPE</IsMarkedToBePrinted> <!-- required -->
                                </FinanceChargePreferences>
                                <JobsAndEstimatesPreferences> <!-- required -->
                                        <IsUsingEstimates >BOOLTYPE</IsUsingEstimates> <!-- required -->
                                        <IsUsingProgressInvoicing >BOOLTYPE</IsUsingProgressInvoicing> <!-- required -->
                                        <IsPrintingItemsWithZeroAmounts >BOOLTYPE</IsPrintingItemsWithZeroAmounts> <!-- required -->
                                </JobsAndEstimatesPreferences>
                                <MultiCurrencyPreferences> <!-- optional -->
                                        <IsMultiCurrencyOn >BOOLTYPE</IsMultiCurrencyOn> <!-- optional -->
                                        <HomeCurrencyRef> <!-- optional -->
                                                <ListID >IDTYPE</ListID> <!-- optional -->
                                                <FullName >STRTYPE</FullName> <!-- optional -->
                                        </HomeCurrencyRef>
                                </MultiCurrencyPreferences>
                                <MultiLocationInventoryPreferences> <!-- optional -->
                                        <IsMultiLocationInventoryAvailable >BOOLTYPE</IsMultiLocationInventoryAvailable> <!-- optional -->
                                        <IsMultiLocationInventoryEnabled >BOOLTYPE</IsMultiLocationInventoryEnabled> <!-- optional -->
                                </MultiLocationInventoryPreferences>
                                <PurchasesAndVendorsPreferences> <!-- required -->
                                        <IsUsingInventory >BOOLTYPE</IsUsingInventory> <!-- required -->
                                        <DaysBillsAreDue >INTTYPE</DaysBillsAreDue> <!-- required -->
                                        <IsAutomaticallyUsingDiscounts >BOOLTYPE</IsAutomaticallyUsingDiscounts> <!-- required -->
                                        <DefaultDiscountAccountRef> <!-- optional -->
                                                <ListID >IDTYPE</ListID> <!-- optional -->
                                                <FullName >STRTYPE</FullName> <!-- optional -->
                                        </DefaultDiscountAccountRef>
                                </PurchasesAndVendorsPreferences>
                                <ReportsPreferences> <!-- required -->
                                        <!-- AgingReportBasis may have one of the following values: AgeFromDueDate, AgeFromTransactionDate -->
                                        <AgingReportBasis >ENUMTYPE</AgingReportBasis> <!-- required -->
                                        <!-- SummaryReportBasis may have one of the following values: Accrual, Cash -->
                                        <SummaryReportBasis >ENUMTYPE</SummaryReportBasis> <!-- required -->
                                </ReportsPreferences>
                                <SalesAndCustomersPreferences> <!-- required -->
                                        <DefaultShipMethodRef> <!-- optional -->
                                                <ListID >IDTYPE</ListID> <!-- optional -->
                                                <FullName >STRTYPE</FullName> <!-- optional -->
                                        </DefaultShipMethodRef>
                                        <DefaultFOB >STRTYPE</DefaultFOB> <!-- optional -->
                                        <DefaultMarkup >PERCENTTYPE</DefaultMarkup> <!-- optional -->
                                        <IsTrackingReimbursedExpensesAsIncome >BOOLTYPE</IsTrackingReimbursedExpensesAsIncome> <!-- required -->
                                        <IsAutoApplyingPayments >BOOLTYPE</IsAutoApplyingPayments> <!-- required -->
                                        <PriceLevels> <!-- optional -->
                                                <IsUsingPriceLevels >BOOLTYPE</IsUsingPriceLevels> <!-- required -->
                                                <IsRoundingSalesPriceUp >BOOLTYPE</IsRoundingSalesPriceUp> <!-- optional -->
                                        </PriceLevels>
                                </SalesAndCustomersPreferences>
                                <SalesTaxPreferences> <!-- optional -->
                                        <DefaultItemSalesTaxRef> <!-- required -->
                                                <ListID >IDTYPE</ListID> <!-- optional -->
                                                <FullName >STRTYPE</FullName> <!-- optional -->
                                        </DefaultItemSalesTaxRef>
                                        <!-- PaySalesTax may have one of the following values: Monthly, Quarterly, Annually -->
                                        <PaySalesTax >ENUMTYPE</PaySalesTax> <!-- required -->
                                        <DefaultTaxableSalesTaxCodeRef> <!-- required -->
                                                <ListID >IDTYPE</ListID> <!-- optional -->
                                                <FullName >STRTYPE</FullName> <!-- optional -->
                                        </DefaultTaxableSalesTaxCodeRef>
                                        <DefaultNonTaxableSalesTaxCodeRef> <!-- required -->
                                                <ListID >IDTYPE</ListID> <!-- optional -->
                                                <FullName >STRTYPE</FullName> <!-- optional -->
                                        </DefaultNonTaxableSalesTaxCodeRef>
                                        <IsUsingVendorTaxCode >BOOLTYPE</IsUsingVendorTaxCode> <!-- optional -->
                                        <IsUsingCustomerTaxCode >BOOLTYPE</IsUsingCustomerTaxCode> <!-- optional -->
                                        <IsUsingAmountsIncludeTax >BOOLTYPE</IsUsingAmountsIncludeTax> <!-- optional -->
                                </SalesTaxPreferences>
                                <TimeTrackingPreferences> <!-- optional -->
                                        <!-- FirstDayOfWeek may have one of the following values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday -->
                                        <FirstDayOfWeek >ENUMTYPE</FirstDayOfWeek> <!-- required -->
                                </TimeTrackingPreferences>
                                <CurrentAppAccessRights> <!-- required -->
                                        <IsAutomaticLoginAllowed >BOOLTYPE</IsAutomaticLoginAllowed> <!-- required -->
                                        <AutomaticLoginUserName >STRTYPE</AutomaticLoginUserName> <!-- optional -->
                                        <IsPersonalDataAccessAllowed >BOOLTYPE</IsPersonalDataAccessAllowed> <!-- required -->
                                </CurrentAppAccessRights>
                                <ItemsAndInventoryPreferences> <!-- optional -->
                                        <EnhancedInventoryReceivingEnabled >BOOLTYPE</EnhancedInventoryReceivingEnabled> <!-- optional -->
                                        <!-- IsTrackingSerialOrLotNumber may have one of the following values: None [DEFAULT], SerialNumber, LotNumber -->
                                        <IsTrackingSerialOrLotNumber >ENUMTYPE</IsTrackingSerialOrLotNumber> <!-- optional -->
                                        <IsInventoryExpirationDateEnabled >BOOLTYPE</IsInventoryExpirationDateEnabled> <!-- optional -->
                                        <isTrackingOnSalesTransactionsEnabled >BOOLTYPE</isTrackingOnSalesTransactionsEnabled> <!-- optional -->
                                        <isTrackingOnPurchaseTransactionsEnabled >BOOLTYPE</isTrackingOnPurchaseTransactionsEnabled> <!-- optional -->
                                        <isTrackingOnInventoryAdjustmentEnabled >BOOLTYPE</isTrackingOnInventoryAdjustmentEnabled> <!-- optional -->
                                        <isTrackingOnBuildAssemblyEnabled >BOOLTYPE</isTrackingOnBuildAssemblyEnabled> <!-- optional -->
                                        <FIFOEnabled >BOOLTYPE</FIFOEnabled> <!-- optional -->
                                        <FIFOEffectiveDate >DATETYPE</FIFOEffectiveDate> <!-- optional -->
                                        <IsRSBEnabled >BOOLTYPE</IsRSBEnabled> <!-- optional -->
                                        <IsBarcodeEnabled >BOOLTYPE</IsBarcodeEnabled> <!-- optional -->
                                </ItemsAndInventoryPreferences>
                        </PreferencesRet>
                </PreferencesQueryRs>
        </QBXMLMsgsRq>
</QBXML>

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
'The following sample code is generated as an illustration of
'Creating requests and parsing responses ONLY
'This code is NOT intended to show best practices or ideal code
'Use at your most careful discretion

imports System
imports System.Net
imports System.Drawing
imports System.Collections
imports System.ComponentModel
imports System.Windows.Forms
imports System.Data
imports System.IO
imports Interop.QBFC16

Module com.intuit.idn.samples
        Public Class Sample
                Public Sub  DoPreferencesQuery()
                        Dim sessionBegun as Boolean
                        sessionBegun = False
                        Dim connectionOpen as Boolean
                        connectionOpen = False
                        Dim sessionManager as QBSessionManager
                        sessionManager = nothing

                        Try
                                'Create the session Manager object
                                sessionManager = new QBSessionManager

                                'Create the message set request object to hold our request
                                Dim requestMsgSet as IMsgSetRequest
                                requestMsgSet = sessionManager.CreateMsgSetRequest("US",16,0)
                                requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue

                                BuildPreferencesQueryRq(requestMsgSet)

                                'Connect to QuickBooks and begin a session
                                sessionManager.OpenConnection("","Sample Code from OSR")
                                connectionOpen = True
                                sessionManager.BeginSession("", ENOpenMode.omDontCare)
                                sessionBegun = True

                                'Send the request and get the response from QuickBooks
                                Dim responseMsgSet as IMsgSetResponse
                                responseMsgSet = sessionManager.DoRequests(requestMsgSet)

                                'End the session and close the connection to QuickBooks
                                sessionManager.EndSession()
                                sessionBegun = False
                                sessionManager.CloseConnection()
                                connectionOpen = False

                                WalkPreferencesQueryRs(responseMsgSet)
                        Catch e as Exception
                                MessageBox.Show(e.Message, "Error")
                                if (sessionBegun) then
                                        sessionManager.EndSession()
                                End If
                                if (connectionOpen) then
                                        sessionManager.CloseConnection()
                                End If
                        End Try
                End Sub
                Public Sub BuildPreferencesQueryRq(requestMsgSet as IMsgSetRequest)
                        Dim PreferencesQueryRq as IPreferencesQuery
                        PreferencesQueryRq= requestMsgSet.AppendPreferencesQueryRq()
                        'Set field value for IncludeRetElementList
                        'May create more than one of these if needed
                        PreferencesQueryRq.IncludeRetElementList.Add("ab")
                End Sub




                Public Sub WalkPreferencesQueryRs( responseMsgSet as IMsgSetResponse)
                        if (responseMsgSet is nothing) then
                                Exit Sub
                        End If

                        Dim responseList as IResponseList
                        responseList = responseMsgSet.ResponseList
                        if (responseList is nothing) then
                                Exit Sub
                        End If

                        'if we sent only one request, there is only one response, we'll walk the list for this sample
                        for j=0 to responseList.Count-1
                                Dim response as IResponse
                                response = responseList.GetAt(j)
                                'check the status code of the response, 0=ok, >0 is warning
                                if (response.StatusCode >= 0) then
                                        'the request-specific response is in the details, make sure we have some
                                        if (not response.Detail is nothing) then
                                                'make sure the response is the type we're expecting
                                                Dim responseType as ENResponseType
                                                responseType = CType(response.Type.GetValue(),ENResponseType)
                                                if (responseType == ENResponseType.rtPreferencesQueryRs) then
                                                        'upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        Dim PreferencesRet as IPreferencesRet
                                                        PreferencesRet = CType(response.Detail,IPreferencesRet)
                                                        WalkPreferencesRet(PreferencesRet)
                                                End If
                                        End If
                                End If
                        Next j
                End Sub




                Public Sub WalkPreferencesRet(PreferencesRet as IPreferencesRet)
                        if (PreferencesRet is nothing) then
                                Exit Sub
                        End If

                        'Go through all the elements of IPreferencesRet
                        'Get value of IsUsingAccountNumbers
                        Dim IsUsingAccountNumbers17389 as Boolean
                        IsUsingAccountNumbers17389 = PreferencesRet.AccountingPreferences.IsUsingAccountNumbers.GetValue()
                        'Get value of IsRequiringAccounts
                        Dim IsRequiringAccounts17390 as Boolean
                        IsRequiringAccounts17390 = PreferencesRet.AccountingPreferences.IsRequiringAccounts.GetValue()
                        'Get value of IsUsingClassTracking
                        Dim IsUsingClassTracking17391 as Boolean
                        IsUsingClassTracking17391 = PreferencesRet.AccountingPreferences.IsUsingClassTracking.GetValue()
                        'Get value of AssignClassesTo
                        if ( not PreferencesRet.AccountingPreferences.AssignClassesTo is nothing) then
                                Dim AssignClassesTo17392 as ENAssignClassesTo
                                AssignClassesTo17392 = PreferencesRet.AccountingPreferences.AssignClassesTo.GetValue()
                        End If
                        'Get value of IsUsingAuditTrail
                        Dim IsUsingAuditTrail17393 as Boolean
                        IsUsingAuditTrail17393 = PreferencesRet.AccountingPreferences.IsUsingAuditTrail.GetValue()
                        'Get value of IsAssigningJournalEntryNumbers
                        Dim IsAssigningJournalEntryNumbers17394 as Boolean
                        IsAssigningJournalEntryNumbers17394 = PreferencesRet.AccountingPreferences.IsAssigningJournalEntryNumbers.GetValue()
                        'Get value of ClosingDate
                        if ( not PreferencesRet.AccountingPreferences.ClosingDate is nothing) then
                                Dim ClosingDate17395 as DateTime
                                ClosingDate17395 = PreferencesRet.AccountingPreferences.ClosingDate.GetValue()
                        End If
                        'Get value of AnnualInterestRate
                        if ( not PreferencesRet.FinanceChargePreferences.AnnualInterestRate is nothing) then
                                Dim AnnualInterestRate17396 as Double
                                AnnualInterestRate17396 = PreferencesRet.FinanceChargePreferences.AnnualInterestRate.GetValue()
                        End If
                        'Get value of MinFinanceCharge
                        if ( not PreferencesRet.FinanceChargePreferences.MinFinanceCharge is nothing) then
                                Dim MinFinanceCharge17397 as Double
                                MinFinanceCharge17397 = PreferencesRet.FinanceChargePreferences.MinFinanceCharge.GetValue()
                        End If
                        'Get value of GracePeriod
                        Dim GracePeriod17398 as Integer
                        GracePeriod17398 = PreferencesRet.FinanceChargePreferences.GracePeriod.GetValue()
                        if (not PreferencesRet.FinanceChargePreferences.FinanceChargeAccountRef. is nothing) then
                                'Get value of ListID
                                if ( not PreferencesRet.FinanceChargePreferences.FinanceChargeAccountRef.ListID is nothing) then
                                        Dim ListID17399 as String
                                        ListID17399 = PreferencesRet.FinanceChargePreferences.FinanceChargeAccountRef.ListID.GetValue()
                                End If
                                'Get value of FullName
                                if ( not PreferencesRet.FinanceChargePreferences.FinanceChargeAccountRef.FullName is nothing) then
                                        Dim FullName17400 as String
                                        FullName17400 = PreferencesRet.FinanceChargePreferences.FinanceChargeAccountRef.FullName.GetValue()
                                End If
                        End If
                        'Get value of IsAssessingForOverdueCharges
                        Dim IsAssessingForOverdueCharges17401 as Boolean
                        IsAssessingForOverdueCharges17401 = PreferencesRet.FinanceChargePreferences.IsAssessingForOverdueCharges.GetValue()
                        'Get value of CalculateChargesFrom
                        Dim CalculateChargesFrom17402 as ENCalculateChargesFrom
                        CalculateChargesFrom17402 = PreferencesRet.FinanceChargePreferences.CalculateChargesFrom.GetValue()
                        'Get value of IsMarkedToBePrinted
                        Dim IsMarkedToBePrinted17403 as Boolean
                        IsMarkedToBePrinted17403 = PreferencesRet.FinanceChargePreferences.IsMarkedToBePrinted.GetValue()
                        'Get value of IsUsingEstimates
                        Dim IsUsingEstimates17404 as Boolean
                        IsUsingEstimates17404 = PreferencesRet.JobsAndEstimatesPreferences.IsUsingEstimates.GetValue()
                        'Get value of IsUsingProgressInvoicing
                        Dim IsUsingProgressInvoicing17405 as Boolean
                        IsUsingProgressInvoicing17405 = PreferencesRet.JobsAndEstimatesPreferences.IsUsingProgressInvoicing.GetValue()
                        'Get value of IsPrintingItemsWithZeroAmounts
                        Dim IsPrintingItemsWithZeroAmounts17406 as Boolean
                        IsPrintingItemsWithZeroAmounts17406 = PreferencesRet.JobsAndEstimatesPreferences.IsPrintingItemsWithZeroAmounts.GetValue()
                        if (not PreferencesRet.MultiCurrencyPreferences. is nothing) then
                                'Get value of IsMultiCurrencyOn
                                if ( not PreferencesRet.MultiCurrencyPreferences.IsMultiCurrencyOn is nothing) then
                                        Dim IsMultiCurrencyOn17407 as Boolean
                                        IsMultiCurrencyOn17407 = PreferencesRet.MultiCurrencyPreferences.IsMultiCurrencyOn.GetValue()
                                End If
                                if (not PreferencesRet.MultiCurrencyPreferences.HomeCurrencyRef. is nothing) then
                                        'Get value of ListID
                                        if ( not PreferencesRet.MultiCurrencyPreferences.HomeCurrencyRef.ListID is nothing) then
                                                Dim ListID17408 as String
                                                ListID17408 = PreferencesRet.MultiCurrencyPreferences.HomeCurrencyRef.ListID.GetValue()
                                        End If
                                        'Get value of FullName
                                        if ( not PreferencesRet.MultiCurrencyPreferences.HomeCurrencyRef.FullName is nothing) then
                                                Dim FullName17409 as String
                                                FullName17409 = PreferencesRet.MultiCurrencyPreferences.HomeCurrencyRef.FullName.GetValue()
                                        End If
                                End If
                        End If
                        if (not PreferencesRet.MultiLocationInventoryPreferences. is nothing) then
                                'Get value of IsMultiLocationInventoryAvailable
                                if ( not PreferencesRet.MultiLocationInventoryPreferences.IsMultiLocationInventoryAvailable is nothing) then
                                        Dim IsMultiLocationInventoryAvailable17410 as Boolean
                                        IsMultiLocationInventoryAvailable17410 = PreferencesRet.MultiLocationInventoryPreferences.IsMultiLocationInventoryAvailable.GetValue()
                                End If
                                'Get value of IsMultiLocationInventoryEnabled
                                if ( not PreferencesRet.MultiLocationInventoryPreferences.IsMultiLocationInventoryEnabled is nothing) then
                                        Dim IsMultiLocationInventoryEnabled17411 as Boolean
                                        IsMultiLocationInventoryEnabled17411 = PreferencesRet.MultiLocationInventoryPreferences.IsMultiLocationInventoryEnabled.GetValue()
                                End If
                        End If
                        'Get value of IsUsingInventory
                        Dim IsUsingInventory17412 as Boolean
                        IsUsingInventory17412 = PreferencesRet.PurchasesAndVendorsPreferences.IsUsingInventory.GetValue()
                        'Get value of DaysBillsAreDue
                        Dim DaysBillsAreDue17413 as Integer
                        DaysBillsAreDue17413 = PreferencesRet.PurchasesAndVendorsPreferences.DaysBillsAreDue.GetValue()
                        'Get value of IsAutomaticallyUsingDiscounts
                        Dim IsAutomaticallyUsingDiscounts17414 as Boolean
                        IsAutomaticallyUsingDiscounts17414 = PreferencesRet.PurchasesAndVendorsPreferences.IsAutomaticallyUsingDiscounts.GetValue()
                        if (not PreferencesRet.PurchasesAndVendorsPreferences.DefaultDiscountAccountRef. is nothing) then
                                'Get value of ListID
                                if ( not PreferencesRet.PurchasesAndVendorsPreferences.DefaultDiscountAccountRef.ListID is nothing) then
                                        Dim ListID17415 as String
                                        ListID17415 = PreferencesRet.PurchasesAndVendorsPreferences.DefaultDiscountAccountRef.ListID.GetValue()
                                End If
                                'Get value of FullName
                                if ( not PreferencesRet.PurchasesAndVendorsPreferences.DefaultDiscountAccountRef.FullName is nothing) then
                                        Dim FullName17416 as String
                                        FullName17416 = PreferencesRet.PurchasesAndVendorsPreferences.DefaultDiscountAccountRef.FullName.GetValue()
                                End If
                        End If
                        'Get value of AgingReportBasis
                        Dim AgingReportBasis17417 as ENAgingReportBasis
                        AgingReportBasis17417 = PreferencesRet.ReportsPreferences.AgingReportBasis.GetValue()
                        'Get value of SummaryReportBasis
                        Dim SummaryReportBasis17418 as ENSummaryReportBasis
                        SummaryReportBasis17418 = PreferencesRet.ReportsPreferences.SummaryReportBasis.GetValue()
                        if (not PreferencesRet.SalesAndCustomersPreferences.DefaultShipMethodRef. is nothing) then
                                'Get value of ListID
                                if ( not PreferencesRet.SalesAndCustomersPreferences.DefaultShipMethodRef.ListID is nothing) then
                                        Dim ListID17419 as String
                                        ListID17419 = PreferencesRet.SalesAndCustomersPreferences.DefaultShipMethodRef.ListID.GetValue()
                                End If
                                'Get value of FullName
                                if ( not PreferencesRet.SalesAndCustomersPreferences.DefaultShipMethodRef.FullName is nothing) then
                                        Dim FullName17420 as String
                                        FullName17420 = PreferencesRet.SalesAndCustomersPreferences.DefaultShipMethodRef.FullName.GetValue()
                                End If
                        End If
                        'Get value of DefaultFOB
                        if ( not PreferencesRet.SalesAndCustomersPreferences.DefaultFOB is nothing) then
                                Dim DefaultFOB17421 as String
                                DefaultFOB17421 = PreferencesRet.SalesAndCustomersPreferences.DefaultFOB.GetValue()
                        End If
                        'Get value of DefaultMarkup
                        if ( not PreferencesRet.SalesAndCustomersPreferences.DefaultMarkup is nothing) then
                                Dim DefaultMarkup17422 as Double
                                DefaultMarkup17422 = PreferencesRet.SalesAndCustomersPreferences.DefaultMarkup.GetValue()
                        End If
                        'Get value of IsTrackingReimbursedExpensesAsIncome
                        Dim IsTrackingReimbursedExpensesAsIncome17423 as Boolean
                        IsTrackingReimbursedExpensesAsIncome17423 = PreferencesRet.SalesAndCustomersPreferences.IsTrackingReimbursedExpensesAsIncome.GetValue()
                        'Get value of IsAutoApplyingPayments
                        Dim IsAutoApplyingPayments17424 as Boolean
                        IsAutoApplyingPayments17424 = PreferencesRet.SalesAndCustomersPreferences.IsAutoApplyingPayments.GetValue()
                        if (not PreferencesRet.SalesAndCustomersPreferences.PriceLevels. is nothing) then
                                'Get value of IsUsingPriceLevels
                                Dim IsUsingPriceLevels17425 as Boolean
                                IsUsingPriceLevels17425 = PreferencesRet.SalesAndCustomersPreferences.PriceLevels.IsUsingPriceLevels.GetValue()
                                'Get value of IsRoundingSalesPriceUp
                                if ( not PreferencesRet.SalesAndCustomersPreferences.PriceLevels.IsRoundingSalesPriceUp is nothing) then
                                        Dim IsRoundingSalesPriceUp17426 as Boolean
                                        IsRoundingSalesPriceUp17426 = PreferencesRet.SalesAndCustomersPreferences.PriceLevels.IsRoundingSalesPriceUp.GetValue()
                                End If
                        End If
                        if (not PreferencesRet.SalesTaxPreferences. is nothing) then
                                'Get value of ListID
                                if ( not PreferencesRet.SalesTaxPreferences.DefaultItemSalesTaxRef.ListID is nothing) then
                                        Dim ListID17427 as String
                                        ListID17427 = PreferencesRet.SalesTaxPreferences.DefaultItemSalesTaxRef.ListID.GetValue()
                                End If
                                'Get value of FullName
                                if ( not PreferencesRet.SalesTaxPreferences.DefaultItemSalesTaxRef.FullName is nothing) then
                                        Dim FullName17428 as String
                                        FullName17428 = PreferencesRet.SalesTaxPreferences.DefaultItemSalesTaxRef.FullName.GetValue()
                                End If
                                'Get value of PaySalesTax
                                Dim PaySalesTax17429 as ENPaySalesTax
                                PaySalesTax17429 = PreferencesRet.SalesTaxPreferences.PaySalesTax.GetValue()
                                'Get value of ListID
                                if ( not PreferencesRet.SalesTaxPreferences.DefaultTaxableSalesTaxCodeRef.ListID is nothing) then
                                        Dim ListID17430 as String
                                        ListID17430 = PreferencesRet.SalesTaxPreferences.DefaultTaxableSalesTaxCodeRef.ListID.GetValue()
                                End If
                                'Get value of FullName
                                if ( not PreferencesRet.SalesTaxPreferences.DefaultTaxableSalesTaxCodeRef.FullName is nothing) then
                                        Dim FullName17431 as String
                                        FullName17431 = PreferencesRet.SalesTaxPreferences.DefaultTaxableSalesTaxCodeRef.FullName.GetValue()
                                End If
                                'Get value of ListID
                                if ( not PreferencesRet.SalesTaxPreferences.DefaultNonTaxableSalesTaxCodeRef.ListID is nothing) then
                                        Dim ListID17432 as String
                                        ListID17432 = PreferencesRet.SalesTaxPreferences.DefaultNonTaxableSalesTaxCodeRef.ListID.GetValue()
                                End If
                                'Get value of FullName
                                if ( not PreferencesRet.SalesTaxPreferences.DefaultNonTaxableSalesTaxCodeRef.FullName is nothing) then
                                        Dim FullName17433 as String
                                        FullName17433 = PreferencesRet.SalesTaxPreferences.DefaultNonTaxableSalesTaxCodeRef.FullName.GetValue()
                                End If
                                'Get value of IsUsingVendorTaxCode
                                if ( not PreferencesRet.SalesTaxPreferences.IsUsingVendorTaxCode is nothing) then
                                        Dim IsUsingVendorTaxCode17434 as Boolean
                                        IsUsingVendorTaxCode17434 = PreferencesRet.SalesTaxPreferences.IsUsingVendorTaxCode.GetValue()
                                End If
                                'Get value of IsUsingCustomerTaxCode
                                if ( not PreferencesRet.SalesTaxPreferences.IsUsingCustomerTaxCode is nothing) then
                                        Dim IsUsingCustomerTaxCode17435 as Boolean
                                        IsUsingCustomerTaxCode17435 = PreferencesRet.SalesTaxPreferences.IsUsingCustomerTaxCode.GetValue()
                                End If
                                'Get value of IsUsingAmountsIncludeTax
                                if ( not PreferencesRet.SalesTaxPreferences.IsUsingAmountsIncludeTax is nothing) then
                                        Dim IsUsingAmountsIncludeTax17436 as Boolean
                                        IsUsingAmountsIncludeTax17436 = PreferencesRet.SalesTaxPreferences.IsUsingAmountsIncludeTax.GetValue()
                                End If
                        End If
                        if (not PreferencesRet.TimeTrackingPreferences. is nothing) then
                                'Get value of FirstDayOfWeek
                                Dim FirstDayOfWeek17437 as ENFirstDayOfWeek
                                FirstDayOfWeek17437 = PreferencesRet.TimeTrackingPreferences.FirstDayOfWeek.GetValue()
                        End If
                        'Get value of IsAutomaticLoginAllowed
                        Dim IsAutomaticLoginAllowed17438 as Boolean
                        IsAutomaticLoginAllowed17438 = PreferencesRet.CurrentAppAccessRights.IsAutomaticLoginAllowed.GetValue()
                        'Get value of AutomaticLoginUserName
                        if ( not PreferencesRet.CurrentAppAccessRights.AutomaticLoginUserName is nothing) then
                                Dim AutomaticLoginUserName17439 as String
                                AutomaticLoginUserName17439 = PreferencesRet.CurrentAppAccessRights.AutomaticLoginUserName.GetValue()
                        End If
                        'Get value of IsPersonalDataAccessAllowed
                        Dim IsPersonalDataAccessAllowed17440 as Boolean
                        IsPersonalDataAccessAllowed17440 = PreferencesRet.CurrentAppAccessRights.IsPersonalDataAccessAllowed.GetValue()
                        if (not PreferencesRet.ItemsAndInventoryPreferences. is nothing) then
                                'Get value of EnhancedInventoryReceivingEnabled
                                if ( not PreferencesRet.ItemsAndInventoryPreferences.EnhancedInventoryReceivingEnabled is nothing) then
                                        Dim EnhancedInventoryReceivingEnabled17441 as Boolean
                                        EnhancedInventoryReceivingEnabled17441 = PreferencesRet.ItemsAndInventoryPreferences.EnhancedInventoryReceivingEnabled.GetValue()
                                End If
                                'Get value of IsTrackingSerialOrLotNumber
                                if ( not PreferencesRet.ItemsAndInventoryPreferences.IsTrackingSerialOrLotNumber is nothing) then
                                        Dim IsTrackingSerialOrLotNumber17442 as ENIsTrackingSerialOrLotNumber
                                        IsTrackingSerialOrLotNumber17442 = PreferencesRet.ItemsAndInventoryPreferences.IsTrackingSerialOrLotNumber.GetValue()
                                End If
                                'Get value of IsInventoryExpirationDateEnabled
                                if ( not PreferencesRet.ItemsAndInventoryPreferences.IsInventoryExpirationDateEnabled is nothing) then
                                        Dim IsInventoryExpDateEnabled as Boolean
                                        IsInventoryExpDateEnabled = PreferencesRet.ItemsAndInventoryPreferences.IsInventoryExpirationDateEnabled.GetValue()
                                End If
                                'Get value of isTrackingOnSalesTransactionsEnabled
                                if ( not PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnSalesTransactionsEnabled is nothing) then
                                        Dim isTrackingOnSalesTransactionsEnabled17443 as Boolean
                                        isTrackingOnSalesTransactionsEnabled17443 = PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnSalesTransactionsEnabled.GetValue()
                                End If
                                'Get value of isTrackingOnPurchaseTransactionsEnabled
                                if ( not PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnPurchaseTransactionsEnabled is nothing) then
                                        Dim isTrackingOnPurchaseTransactionsEnabled17444 as Boolean
                                        isTrackingOnPurchaseTransactionsEnabled17444 = PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnPurchaseTransactionsEnabled.GetValue()
                                End If
                                'Get value of isTrackingOnInventoryAdjustmentEnabled
                                if ( not PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnInventoryAdjustmentEnabled is nothing) then
                                        Dim isTrackingOnInventoryAdjustmentEnabled17445 as Boolean
                                        isTrackingOnInventoryAdjustmentEnabled17445 = PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnInventoryAdjustmentEnabled.GetValue()
                                End If
                                'Get value of isTrackingOnBuildAssemblyEnabled
                                if ( not PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnBuildAssemblyEnabled is nothing) then
                                        Dim isTrackingOnBuildAssemblyEnabled17446 as Boolean
                                        isTrackingOnBuildAssemblyEnabled17446 = PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnBuildAssemblyEnabled.GetValue()
                                End If
                                'Get value of FIFOEnabled
                                if ( not PreferencesRet.ItemsAndInventoryPreferences.FIFOEnabled is nothing) then
                                        Dim FIFOEnabled17447 as Boolean
                                        FIFOEnabled17447 = PreferencesRet.ItemsAndInventoryPreferences.FIFOEnabled.GetValue()
                                End If
                                'Get value of FIFOEffectiveDate
                                if ( not PreferencesRet.ItemsAndInventoryPreferences.FIFOEffectiveDate is nothing) then
                                        Dim FIFOEffectiveDate17448 as DateTime
                                        FIFOEffectiveDate17448 = PreferencesRet.ItemsAndInventoryPreferences.FIFOEffectiveDate.GetValue()
                                End If
                                'Get value of IsRSBEnabled
                                if ( not PreferencesRet.ItemsAndInventoryPreferences.IsRSBEnabled is nothing) then
                                        Dim IsRSBEnabled17449 as Boolean
                                        IsRSBEnabled17449 = PreferencesRet.ItemsAndInventoryPreferences.IsRSBEnabled.GetValue()
                                End If
                                'Get value of IsBarcodeEnabled
                                if ( not PreferencesRet.ItemsAndInventoryPreferences.IsBarcodeEnabled is nothing) then
                                        Dim IsBarcodeEnabled17450 as Boolean
                                        IsBarcodeEnabled17450 = PreferencesRet.ItemsAndInventoryPreferences.IsBarcodeEnabled.GetValue()
                                End If
                        End If
                End Sub




        End Class
End Module

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
//The following sample code is generated as an illustration of
//Creating requests and parsing responses ONLY
//This code is NOT intended to show best practices or ideal code
//Use at your most careful discretion

using System;
using System.Net;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using Interop.QBFC16;

namespace com.intuit.idn.samples
{
        public class Sample
        {
                public void  DoPreferencesQuery()
                {
                        bool sessionBegun = false;
                        bool connectionOpen = false;
                        QBSessionManager sessionManager = null;

                        try
                        {
                                //Create the session Manager object
                                sessionManager = new QBSessionManager();

                                //Create the message set request object to hold our request
                                IMsgSetRequest requestMsgSet = sessionManager.CreateMsgSetRequest("US",16,0);
                                requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue;

                                BuildPreferencesQueryRq(requestMsgSet);

                                //Connect to QuickBooks and begin a session
                                sessionManager.OpenConnection("","Sample Code from OSR");
                                connectionOpen = true;
                                sessionManager.BeginSession("", ENOpenMode.omDontCare);
                                sessionBegun = true;

                                //Send the request and get the response from QuickBooks
                                IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet);

                                //End the session and close the connection to QuickBooks
                                sessionManager.EndSession();
                                sessionBegun = false;
                                sessionManager.CloseConnection();
                                connectionOpen = false;

                                WalkPreferencesQueryRs(responseMsgSet);
                        }
                        catch (Exception e)
                        {
                                MessageBox.Show(e.Message, "Error");
                                if (sessionBegun)
                                {
                                        sessionManager.EndSession();
                                }
                                if (connectionOpen)
                                {
                                        sessionManager.CloseConnection();
                                }
                        }
                }
                void BuildPreferencesQueryRq(IMsgSetRequest requestMsgSet)
                {
                        IPreferencesQuery PreferencesQueryRq= requestMsgSet.AppendPreferencesQueryRq();
                        //Set field value for IncludeRetElementList
                        //May create more than one of these if needed
                        PreferencesQueryRq.IncludeRetElementList.Add("ab");
                }




                void WalkPreferencesQueryRs(IMsgSetResponse responseMsgSet)
                {
                        if (responseMsgSet == null) return;
                        IResponseList responseList = responseMsgSet.ResponseList;
                        if (responseList == null) return;
                        //if we sent only one request, there is only one response, we'll walk the list for this sample
                        for(int i=0; i < responseList.Count; i++)
                        {
                                IResponse response = responseList.GetAt(i);
                                //check the status code of the response, 0=ok, >0 is warning
                                if (response.StatusCode >= 0)
                                {
                                        //the request-specific response is in the details, make sure we have some
                                        if (response.Detail != null)
                                        {
                                                //make sure the response is the type we're expecting
                                                ENResponseType responseType = (ENResponseType)response.Type.GetValue();
                                                if (responseType == ENResponseType.rtPreferencesQueryRs)
                                                {
                                                        //upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        IPreferencesRet PreferencesRet = (IPreferencesRet)response.Detail;
                                                        WalkPreferencesRet(PreferencesRet);
                                                }
                                        }
                                }
                        }
                }




                void WalkPreferencesRet(IPreferencesRet PreferencesRet)
                {
                        if (PreferencesRet == null) return;
                        //Go through all the elements of IPreferencesRet
                        //Get value of IsUsingAccountNumbers
                        bool IsUsingAccountNumbers17327 = (bool)PreferencesRet.AccountingPreferences.IsUsingAccountNumbers.GetValue();
                        //Get value of IsRequiringAccounts
                        bool IsRequiringAccounts17328 = (bool)PreferencesRet.AccountingPreferences.IsRequiringAccounts.GetValue();
                        //Get value of IsUsingClassTracking
                        bool IsUsingClassTracking17329 = (bool)PreferencesRet.AccountingPreferences.IsUsingClassTracking.GetValue();
                        //Get value of AssignClassesTo
                        if (PreferencesRet.AccountingPreferences.AssignClassesTo != null)
                        {
                                ENAssignClassesTo AssignClassesTo17330 = (ENAssignClassesTo)PreferencesRet.AccountingPreferences.AssignClassesTo.GetValue();
                        }
                        //Get value of IsUsingAuditTrail
                        bool IsUsingAuditTrail17331 = (bool)PreferencesRet.AccountingPreferences.IsUsingAuditTrail.GetValue();
                        //Get value of IsAssigningJournalEntryNumbers
                        bool IsAssigningJournalEntryNumbers17332 = (bool)PreferencesRet.AccountingPreferences.IsAssigningJournalEntryNumbers.GetValue();
                        //Get value of ClosingDate
                        if (PreferencesRet.AccountingPreferences.ClosingDate != null)
                        {
                                DateTime ClosingDate17333 = (DateTime)PreferencesRet.AccountingPreferences.ClosingDate.GetValue();
                        }
                        //Get value of AnnualInterestRate
                        if (PreferencesRet.FinanceChargePreferences.AnnualInterestRate != null)
                        {
                                double AnnualInterestRate17334 = (double)PreferencesRet.FinanceChargePreferences.AnnualInterestRate.GetValue();
                        }
                        //Get value of MinFinanceCharge
                        if (PreferencesRet.FinanceChargePreferences.MinFinanceCharge != null)
                        {
                                double MinFinanceCharge17335 = (double)PreferencesRet.FinanceChargePreferences.MinFinanceCharge.GetValue();
                        }
                        //Get value of GracePeriod
                        int GracePeriod17336 = (int)PreferencesRet.FinanceChargePreferences.GracePeriod.GetValue();
                        if (PreferencesRet.FinanceChargePreferences.FinanceChargeAccountRef != null)
                        {
                                //Get value of ListID
                                if (PreferencesRet.FinanceChargePreferences.FinanceChargeAccountRef.ListID != null)
                                {
                                        string ListID17337 = (string)PreferencesRet.FinanceChargePreferences.FinanceChargeAccountRef.ListID.GetValue();
                                }
                                //Get value of FullName
                                if (PreferencesRet.FinanceChargePreferences.FinanceChargeAccountRef.FullName != null)
                                {
                                        string FullName17338 = (string)PreferencesRet.FinanceChargePreferences.FinanceChargeAccountRef.FullName.GetValue();
                                }
                        }
                        //Get value of IsAssessingForOverdueCharges
                        bool IsAssessingForOverdueCharges17339 = (bool)PreferencesRet.FinanceChargePreferences.IsAssessingForOverdueCharges.GetValue();
                        //Get value of CalculateChargesFrom
                        ENCalculateChargesFrom CalculateChargesFrom17340 = (ENCalculateChargesFrom)PreferencesRet.FinanceChargePreferences.CalculateChargesFrom.GetValue();
                        //Get value of IsMarkedToBePrinted
                        bool IsMarkedToBePrinted17341 = (bool)PreferencesRet.FinanceChargePreferences.IsMarkedToBePrinted.GetValue();
                        //Get value of IsUsingEstimates
                        bool IsUsingEstimates17342 = (bool)PreferencesRet.JobsAndEstimatesPreferences.IsUsingEstimates.GetValue();
                        //Get value of IsUsingProgressInvoicing
                        bool IsUsingProgressInvoicing17343 = (bool)PreferencesRet.JobsAndEstimatesPreferences.IsUsingProgressInvoicing.GetValue();
                        //Get value of IsPrintingItemsWithZeroAmounts
                        bool IsPrintingItemsWithZeroAmounts17344 = (bool)PreferencesRet.JobsAndEstimatesPreferences.IsPrintingItemsWithZeroAmounts.GetValue();
                        if (PreferencesRet.MultiCurrencyPreferences != null)
                        {
                                //Get value of IsMultiCurrencyOn
                                if (PreferencesRet.MultiCurrencyPreferences.IsMultiCurrencyOn != null)
                                {
                                        bool IsMultiCurrencyOn17345 = (bool)PreferencesRet.MultiCurrencyPreferences.IsMultiCurrencyOn.GetValue();
                                }
                                if (PreferencesRet.MultiCurrencyPreferences.HomeCurrencyRef != null)
                                {
                                        //Get value of ListID
                                        if (PreferencesRet.MultiCurrencyPreferences.HomeCurrencyRef.ListID != null)
                                        {
                                                string ListID17346 = (string)PreferencesRet.MultiCurrencyPreferences.HomeCurrencyRef.ListID.GetValue();
                                        }
                                        //Get value of FullName
                                        if (PreferencesRet.MultiCurrencyPreferences.HomeCurrencyRef.FullName != null)
                                        {
                                                string FullName17347 = (string)PreferencesRet.MultiCurrencyPreferences.HomeCurrencyRef.FullName.GetValue();
                                        }
                                }
                        }
                        if (PreferencesRet.MultiLocationInventoryPreferences != null)
                        {
                                //Get value of IsMultiLocationInventoryAvailable
                                if (PreferencesRet.MultiLocationInventoryPreferences.IsMultiLocationInventoryAvailable != null)
                                {
                                        bool IsMultiLocationInventoryAvailable17348 = (bool)PreferencesRet.MultiLocationInventoryPreferences.IsMultiLocationInventoryAvailable.GetValue();
                                }
                                //Get value of IsMultiLocationInventoryEnabled
                                if (PreferencesRet.MultiLocationInventoryPreferences.IsMultiLocationInventoryEnabled != null)
                                {
                                        bool IsMultiLocationInventoryEnabled17349 = (bool)PreferencesRet.MultiLocationInventoryPreferences.IsMultiLocationInventoryEnabled.GetValue();
                                }
                        }
                        //Get value of IsUsingInventory
                        bool IsUsingInventory17350 = (bool)PreferencesRet.PurchasesAndVendorsPreferences.IsUsingInventory.GetValue();
                        //Get value of DaysBillsAreDue
                        int DaysBillsAreDue17351 = (int)PreferencesRet.PurchasesAndVendorsPreferences.DaysBillsAreDue.GetValue();
                        //Get value of IsAutomaticallyUsingDiscounts
                        bool IsAutomaticallyUsingDiscounts17352 = (bool)PreferencesRet.PurchasesAndVendorsPreferences.IsAutomaticallyUsingDiscounts.GetValue();
                        if (PreferencesRet.PurchasesAndVendorsPreferences.DefaultDiscountAccountRef != null)
                        {
                                //Get value of ListID
                                if (PreferencesRet.PurchasesAndVendorsPreferences.DefaultDiscountAccountRef.ListID != null)
                                {
                                        string ListID17353 = (string)PreferencesRet.PurchasesAndVendorsPreferences.DefaultDiscountAccountRef.ListID.GetValue();
                                }
                                //Get value of FullName
                                if (PreferencesRet.PurchasesAndVendorsPreferences.DefaultDiscountAccountRef.FullName != null)
                                {
                                        string FullName17354 = (string)PreferencesRet.PurchasesAndVendorsPreferences.DefaultDiscountAccountRef.FullName.GetValue();
                                }
                        }
                        //Get value of AgingReportBasis
                        ENAgingReportBasis AgingReportBasis17355 = (ENAgingReportBasis)PreferencesRet.ReportsPreferences.AgingReportBasis.GetValue();
                        //Get value of SummaryReportBasis
                        ENSummaryReportBasis SummaryReportBasis17356 = (ENSummaryReportBasis)PreferencesRet.ReportsPreferences.SummaryReportBasis.GetValue();
                        if (PreferencesRet.SalesAndCustomersPreferences.DefaultShipMethodRef != null)
                        {
                                //Get value of ListID
                                if (PreferencesRet.SalesAndCustomersPreferences.DefaultShipMethodRef.ListID != null)
                                {
                                        string ListID17357 = (string)PreferencesRet.SalesAndCustomersPreferences.DefaultShipMethodRef.ListID.GetValue();
                                }
                                //Get value of FullName
                                if (PreferencesRet.SalesAndCustomersPreferences.DefaultShipMethodRef.FullName != null)
                                {
                                        string FullName17358 = (string)PreferencesRet.SalesAndCustomersPreferences.DefaultShipMethodRef.FullName.GetValue();
                                }
                        }
                        //Get value of DefaultFOB
                        if (PreferencesRet.SalesAndCustomersPreferences.DefaultFOB != null)
                        {
                                string DefaultFOB17359 = (string)PreferencesRet.SalesAndCustomersPreferences.DefaultFOB.GetValue();
                        }
                        //Get value of DefaultMarkup
                        if (PreferencesRet.SalesAndCustomersPreferences.DefaultMarkup != null)
                        {
                                double DefaultMarkup17360 = (double)PreferencesRet.SalesAndCustomersPreferences.DefaultMarkup.GetValue();
                        }
                        //Get value of IsTrackingReimbursedExpensesAsIncome
                        bool IsTrackingReimbursedExpensesAsIncome17361 = (bool)PreferencesRet.SalesAndCustomersPreferences.IsTrackingReimbursedExpensesAsIncome.GetValue();
                        //Get value of IsAutoApplyingPayments
                        bool IsAutoApplyingPayments17362 = (bool)PreferencesRet.SalesAndCustomersPreferences.IsAutoApplyingPayments.GetValue();
                        if (PreferencesRet.SalesAndCustomersPreferences.PriceLevels != null)
                        {
                                //Get value of IsUsingPriceLevels
                                bool IsUsingPriceLevels17363 = (bool)PreferencesRet.SalesAndCustomersPreferences.PriceLevels.IsUsingPriceLevels.GetValue();
                                //Get value of IsRoundingSalesPriceUp
                                if (PreferencesRet.SalesAndCustomersPreferences.PriceLevels.IsRoundingSalesPriceUp != null)
                                {
                                        bool IsRoundingSalesPriceUp17364 = (bool)PreferencesRet.SalesAndCustomersPreferences.PriceLevels.IsRoundingSalesPriceUp.GetValue();
                                }
                        }
                        if (PreferencesRet.SalesTaxPreferences != null)
                        {
                                //Get value of ListID
                                if (PreferencesRet.SalesTaxPreferences.DefaultItemSalesTaxRef.ListID != null)
                                {
                                        string ListID17365 = (string)PreferencesRet.SalesTaxPreferences.DefaultItemSalesTaxRef.ListID.GetValue();
                                }
                                //Get value of FullName
                                if (PreferencesRet.SalesTaxPreferences.DefaultItemSalesTaxRef.FullName != null)
                                {
                                        string FullName17366 = (string)PreferencesRet.SalesTaxPreferences.DefaultItemSalesTaxRef.FullName.GetValue();
                                }
                                //Get value of PaySalesTax
                                ENPaySalesTax PaySalesTax17367 = (ENPaySalesTax)PreferencesRet.SalesTaxPreferences.PaySalesTax.GetValue();
                                //Get value of ListID
                                if (PreferencesRet.SalesTaxPreferences.DefaultTaxableSalesTaxCodeRef.ListID != null)
                                {
                                        string ListID17368 = (string)PreferencesRet.SalesTaxPreferences.DefaultTaxableSalesTaxCodeRef.ListID.GetValue();
                                }
                                //Get value of FullName
                                if (PreferencesRet.SalesTaxPreferences.DefaultTaxableSalesTaxCodeRef.FullName != null)
                                {
                                        string FullName17369 = (string)PreferencesRet.SalesTaxPreferences.DefaultTaxableSalesTaxCodeRef.FullName.GetValue();
                                }
                                //Get value of ListID
                                if (PreferencesRet.SalesTaxPreferences.DefaultNonTaxableSalesTaxCodeRef.ListID != null)
                                {
                                        string ListID17370 = (string)PreferencesRet.SalesTaxPreferences.DefaultNonTaxableSalesTaxCodeRef.ListID.GetValue();
                                }
                                //Get value of FullName
                                if (PreferencesRet.SalesTaxPreferences.DefaultNonTaxableSalesTaxCodeRef.FullName != null)
                                {
                                        string FullName17371 = (string)PreferencesRet.SalesTaxPreferences.DefaultNonTaxableSalesTaxCodeRef.FullName.GetValue();
                                }
                                //Get value of IsUsingVendorTaxCode
                                if (PreferencesRet.SalesTaxPreferences.IsUsingVendorTaxCode != null)
                                {
                                        bool IsUsingVendorTaxCode17372 = (bool)PreferencesRet.SalesTaxPreferences.IsUsingVendorTaxCode.GetValue();
                                }
                                //Get value of IsUsingCustomerTaxCode
                                if (PreferencesRet.SalesTaxPreferences.IsUsingCustomerTaxCode != null)
                                {
                                        bool IsUsingCustomerTaxCode17373 = (bool)PreferencesRet.SalesTaxPreferences.IsUsingCustomerTaxCode.GetValue();
                                }
                                //Get value of IsUsingAmountsIncludeTax
                                if (PreferencesRet.SalesTaxPreferences.IsUsingAmountsIncludeTax != null)
                                {
                                        bool IsUsingAmountsIncludeTax17374 = (bool)PreferencesRet.SalesTaxPreferences.IsUsingAmountsIncludeTax.GetValue();
                                }
                        }
                        if (PreferencesRet.TimeTrackingPreferences != null)
                        {
                                //Get value of FirstDayOfWeek
                                ENFirstDayOfWeek FirstDayOfWeek17375 = (ENFirstDayOfWeek)PreferencesRet.TimeTrackingPreferences.FirstDayOfWeek.GetValue();
                        }
                        //Get value of IsAutomaticLoginAllowed
                        bool IsAutomaticLoginAllowed17376 = (bool)PreferencesRet.CurrentAppAccessRights.IsAutomaticLoginAllowed.GetValue();
                        //Get value of AutomaticLoginUserName
                        if (PreferencesRet.CurrentAppAccessRights.AutomaticLoginUserName != null)
                        {
                                string AutomaticLoginUserName17377 = (string)PreferencesRet.CurrentAppAccessRights.AutomaticLoginUserName.GetValue();
                        }
                        //Get value of IsPersonalDataAccessAllowed
                        bool IsPersonalDataAccessAllowed17378 = (bool)PreferencesRet.CurrentAppAccessRights.IsPersonalDataAccessAllowed.GetValue();
                        if (PreferencesRet.ItemsAndInventoryPreferences != null)
                        {
                                //Get value of EnhancedInventoryReceivingEnabled
                                if (PreferencesRet.ItemsAndInventoryPreferences.EnhancedInventoryReceivingEnabled != null)
                                {
                                        bool EnhancedInventoryReceivingEnabled17379 = (bool)PreferencesRet.ItemsAndInventoryPreferences.EnhancedInventoryReceivingEnabled.GetValue();
                                }
                                //Get value of IsTrackingSerialOrLotNumber
                                if (PreferencesRet.ItemsAndInventoryPreferences.IsTrackingSerialOrLotNumber != null)
                                {
                                        ENIsTrackingSerialOrLotNumber IsTrackingSerialOrLotNumber17380 = (ENIsTrackingSerialOrLotNumber)PreferencesRet.ItemsAndInventoryPreferences.IsTrackingSerialOrLotNumber.GetValue();
                                }
                                //Get value of IsInventoryExpirationDateEnabled
                                if (PreferencesRet.ItemsAndInventoryPreferences.IsInventoryExpirationDateEnabled != null)
                                {
                                        bool IsInventoryExpDateEnabled = (bool)PreferencesRet.ItemsAndInventoryPreferences.IsInventoryExpirationDateEnabled.GetValue();
                                }
                                //Get value of isTrackingOnSalesTransactionsEnabled
                                if (PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnSalesTransactionsEnabled != null)
                                {
                                        bool isTrackingOnSalesTransactionsEnabled17381 = (bool)PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnSalesTransactionsEnabled.GetValue();
                                }
                                //Get value of isTrackingOnPurchaseTransactionsEnabled
                                if (PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnPurchaseTransactionsEnabled != null)
                                {
                                        bool isTrackingOnPurchaseTransactionsEnabled17382 = (bool)PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnPurchaseTransactionsEnabled.GetValue();
                                }
                                //Get value of isTrackingOnInventoryAdjustmentEnabled
                                if (PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnInventoryAdjustmentEnabled != null)
                                {
                                        bool isTrackingOnInventoryAdjustmentEnabled17383 = (bool)PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnInventoryAdjustmentEnabled.GetValue();
                                }
                                //Get value of isTrackingOnBuildAssemblyEnabled
                                if (PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnBuildAssemblyEnabled != null)
                                {
                                        bool isTrackingOnBuildAssemblyEnabled17384 = (bool)PreferencesRet.ItemsAndInventoryPreferences.isTrackingOnBuildAssemblyEnabled.GetValue();
                                }
                                //Get value of FIFOEnabled
                                if (PreferencesRet.ItemsAndInventoryPreferences.FIFOEnabled != null)
                                {
                                        bool FIFOEnabled17385 = (bool)PreferencesRet.ItemsAndInventoryPreferences.FIFOEnabled.GetValue();
                                }
                                //Get value of FIFOEffectiveDate
                                if (PreferencesRet.ItemsAndInventoryPreferences.FIFOEffectiveDate != null)
                                {
                                        DateTime FIFOEffectiveDate17386 = (DateTime)PreferencesRet.ItemsAndInventoryPreferences.FIFOEffectiveDate.GetValue();
                                }
                                //Get value of IsRSBEnabled
                                if (PreferencesRet.ItemsAndInventoryPreferences.IsRSBEnabled != null)
                                {
                                        bool IsRSBEnabled17387 = (bool)PreferencesRet.ItemsAndInventoryPreferences.IsRSBEnabled.GetValue();
                                }
                                //Get value of IsBarcodeEnabled
                                if (PreferencesRet.ItemsAndInventoryPreferences.IsBarcodeEnabled != null)
                                {
                                        bool IsBarcodeEnabled17388 = (bool)PreferencesRet.ItemsAndInventoryPreferences.IsBarcodeEnabled.GetValue();
                                }
                        }
                }




        }
}