PurchaseOrderQuery


Request

Response

XMLOPS

VB.NET

C#

Tag Type Max length Implementation Required

IPurchaseOrderQuery

       

metaData

This is used in a query to cause a count of query objects to be returned. You can specify that the count of query objects is to be returned with the returned objects, or you can specify that only a count and no data is returned. (The default is that no count is returned.) A common use of this feature is to specify a count with no data in order to determine how many objects to expect from the actual query. If you don’t want a query to return a count, either don’t use this feature, or specify the value NoMetaData. If you want only a count, specify the value MetaDataOnly. If you want data and a count, specify MetaDataAndResponseData. You should be aware that the count returned via this setting is not guaranteed to be exact: it could be off slightly due to new object creation or deletions.
IQBENmetaDataType   4.0|us.png|  

iterator

The iterator attribute provided with most query types also allows you to break down query results in smaller and more manageable chunks of data. An iterator results in responses that contain only the specified number of objects. Iterators are only valid for the application that starts them, and they are only valid for the current QuickBooks session.
IQBENiteratorType   5.0|us.png|  

iteratorID

The iterator query attribute is provided with most query types to allow you to break down query results into smaller and more manageable chunks of data. An iterator results in responses that contain only the specified number of objects. The iterator is created when a query contains the iterator attribute set to Start, along with a MaxReturn value specifying how many records are to be returned in each iteration. The response to that first query iteration contains, along with the response data, an IteratorID value that uniquely identifies that iterator. This is important because you can have many iterators active at the same time. Accordingly, in subsequent iterations of that query, you need to supply that returned iteratorID so the SDK knows where to resume the iteration.
IQBUUIDType   5.0|us.png|  

MaxReturned

This element is used for limiting the number of objects returned in the query to the number specified in MaxReturned. It is required if you use the Iterator attribute to iterate through large or potentially large query returns. When used with the Iterator, MaxReturned specifies the number of records returned in each iteration. It can be modified during the iteration. For details on the Iterator, please refer to the QBPOS SDK Programming Guide. A less optimal, but still possible way to use this element is as follows. You can use this element by itself to chunk up data, by initially using a range filter with the desired starting (From range) and ending range (To range). Then, in subsequent queries, leave the To range alone, but change the From range to coincide with the last object from the previous query.
IQBIntType      

OwnerIDList

The list of Owner IDs in the requests. An ownerID refers to the owner of a data extension:If OwnerID is 0, this is a public data extension. For example, if you intend to use this with a custom field that is supported in the UI, you must use an owner ID of 0.If OwnerID is a GUID, for example {6B063959-81B0-4622-85D6-F548C8CCB517}, this field is a private data extension defined by an integrated application. Note that OwnerID values are not case-sensitive, meaning that if you enter an OwnerID value with lower-case letters, the value will be saved and returned with upper-case letters. When you share a private data extension with another application, the other application must know both the OwnerID and the DataExtName, as these together form a data extension’s unique name.
IGUIDList      

TxnID

QuickBooks generates a unique TxnID for each transaction that is added to QuickBooks. A TxnID returned from a request can be used to refer to the transaction in subsequent requests. Notice that you cannot supply the TxnID of a TimeTracking transaction to TransactionQueryRq requests. If you do, you get an error stating that no such record could be found, even though the transaction is in QuickBooks. This behavior reflects the behavior in the QuicKBooks UI in the Find window.
IQBIDType      

ORTimeCreatedFilters

IORTimeCreatedFilters   1.1  

TimeCreatedFilter

Filters by the object’s time created value.
ITimeCreatedFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TimeCreated

The timestamp indicating the time when this object was created in QBPOS.
IQBDateTimeType     Y

TimeCreatedRangeFilter

Filters by a range of time created values.
ITimeCreatedRangeFilter      

FromTimeCreated

The beginning of the range.
IQBDateTimeType     Y

ToTimeCreated

The end of the range.
IQBDateTimeType     Y

ORTimeModifiedFilters

IORTimeModifiedFilters      

TimeModifiedFilter

Searches for objects that were modified before, at, or after the specified time.
ITimeModifiedFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TimeModified

The time when the object was modified by QBPOS.
IQBDateTimeType     Y

TimeModifiedRangeFilter

Searches for objects that were modified within the specified time range.
ITimeModifiedRangeFilter      

FromTimeModified

First time value possible in the range.
IQBDateTimeType     Y

ToTimeModified

Last time value of the range.
IQBDateTimeType     Y

ORAssociateFilters

IORAssociateFilters      

AssociateFilter

Filters by the specified associate name string or substring.
IAssociateFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

Associate

The employee making the adjustment transaction.
IQBStringType 40 chars   Y

AssociateRangeFilter

Filters by the specified range of name values.
IAssociateRangeFilter      

FromAssociate

Starting value in the range filter.
IQBStringType 40 chars   Y

ToAssociate

Ending value in the specified range.
IQBStringType 40 chars   Y

ORCancelDateFilters

IORCancelDateFilters      

CancelDateFilter

Filters PurchaseOrders by their cancel date.
ICancelDateFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

CancelDate

Enter the date after which delivery may be refused. If the company preferences for receiving are set to check for cancel dates, the end user is alerted when receiving items against a PO past this cancel date. (That user can still accept the shipment at the user’s discretion.) If the company preferences for receiving are not set to check the Cancel date, the Cancel date is ignored.
IQBDateType     Y

CancelDateRangeFilter

Filters PurchaseOrders by a range of cancel dates.
ICancelDateRangeFilter      

FromCancelDate

Start of the range.
IQBDateType     Y

ToCancelDate

End of the range.
IQBDateType     Y

ORCompanyNameFilters

IORCompanyNameFilters      

CompanyNameFilter

Filters objects by the customer or vendor’s company name value.
ICompanyNameFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

CompanyName

The name of the business.
IQBStringType 41 chars   Y

CompanyNameRangeFilter

Filters objects by a range of company name values.
ICompanyNameRangeFilter      

FromCompanyName

Start of the range of CompanyName values.
IQBStringType 41 chars   Y

ToCompanyName

End of the range of CompanyName values.
IQBStringType 41 chars   Y

ORDiscountFilters

IORDiscountFilters      

DiscountFilter

Filters vouchers by their discount value.
IDiscountFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

Discount

Discount amount: Enter the amount of any discount applicable to the PO. Discounts are applied to the PO subtotal. Entering an amount causes the Disc % field to be automatically calculated.
IQBAmountType     Y

DiscountRangeFilter

Filters vouchers by a range of Discount values.
IDiscountRangeFilter      

FromDiscount

Start of the Discount range.
IQBAmountType     Y

ToDiscount

End of the Discount range.
IQBAmountType     Y

ORDiscountPercentFilters

IORDiscountPercentFilters      

DiscountPercentFilter

Filters vouchers by their discountpercent values.
IDiscountPercentFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

DiscountPercent

Enter a percentage discount applicable to the PO. Discounts are applied to the PO subtotal. Entering a discount percentage causes the Disc $ field to be automatically calculated.
IQBFloatType     Y

DiscountPercentRangeFilter

Filters vouchers by a range of discountpercent values.
IDiscountPercentRangeFilter      

FromDiscountPercent

Start of the DiscountPercent range.
IQBFloatType     Y

ToDiscountPercent

End of the DiscountPercent range.
IQBFloatType     Y

ORFeeFilters

IORFeeFilters      

FeeFilter

Searches for POs with fee values specified by the filter.
IFeeFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

Fee

You can enter a fee using this field. Notice that Fees entered on a PO (such as a special handling fee) are not spread over the cost of individual items. When a receiving voucher references a PO with a fee entered, the fee can be transferred to the voucher at that point.
IQBAmountType     Y

FeeRangeFilter

Searches for POs whose Fee values fall within the specified range.
IFeeRangeFilter      

FromFee

Start of the range.
IQBAmountType     Y

ToFee

End of the fee range.
IQBAmountType     Y

ORInstructionsFilters

IORInstructionsFilters      

InstructionsFilter

Filters PurchaseOrders by their Instructions field.
IInstructionsFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

Instructions

You can use this optional field to provide instructions to the vendor regarding the order. You can add up to two lines of text. This text prints on PurchaseOrders, but are not displayed on-screen.
IQBStringType 2000 chars   Y

InstructionsRangeFilter

Filters PurchaseOrders by a range of Instruction field values date.
IInstructionsRangeFilter      

FromInstructions

Start of the range.
IQBStringType 2000 chars   Y

ToInstructions

End of the range.
IQBStringType 2000 chars   Y

ORItemsCountFilters

IORItemsCountFilters      

ItemsCountFilter

Filters adjustments by those with a specified number of line items.
IItemsCountFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

ItemsCount

The number of line items in the adjustment add request that added the adjustment to QBPOS.
IQBIntType     Y

ItemsCountRangeFilter

Specifies a range of adjustment line items to search for.
IItemsCountRangeFilter      

FromItemsCount

Specifies the start of the range.
IQBIntType     Y

ToItemsCount

Specifies the end of the range.
IQBIntType     Y

ORPurchaseOrderNumberFilters

IORPurchaseOrderNumberFilters      

PurchaseOrderNumberFilter

Filters vouchers by the PurchaseOrder received against.
IPurchaseOrderNumberFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

PurchaseOrderNumber

The number you want to assign to the purchase order. It should be unique. This number is automatically assigned to the PurchaseOrder by QBPOS if left empty during the creation process. An example of setting PO numbers is when you create a PO from a SalesOrder. You can use the SalesOrder number prefaced by PO, to show in the PO number the linkage between the sales order and the purchase order.
IQBStringType 20 chars   Y

PurchaseOrderNumberRangeFilter

Filters vouchers by a range of purchase orders.
IPurchaseOrderNumberRangeFilter      

FromPurchaseOrderNumber

Start of the PurchaseOrder number range.
IQBStringType 20 chars   Y

ToPurchaseOrderNumber

End of the PurchaseOrder number range.
IQBStringType 20 chars   Y

PurchaseOrderStatusDesc

All PurchaseOrders have the status of either Open, Closed, or Custom. The Custom status is defined by the QBPOS user in Company Preferences for Purchasing. It has a user-specified description field.
IQBStringType      

ORQtyOrderedFilters

IORQtyOrderedFilters      

QtyOrderedFilter

Searches for POs whose QtyOrdered values matches the specified filter.
IQtyOrderedFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

QtyOrdered

PO Totals and PO list: The total PO quantity ordered, combined for all items.
IQBQuanType     Y

QtyOrderedRangeFilter

Searches for POs whose QtyOrdered values fall within the specified range.
IQtyOrderedRangeFilter      

FromQtyOrdered

Start of the range.
IQBQuanType     Y

ToQtyOrdered

End of the QtyOrdered range.
IQBQuanType     Y

ORQtyReceivedFilters

IORQtyReceivedFilters      

QtyReceivedFilter

Searches for POs whose QtyReceived values match the specified filter.
IQtyReceivedFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

QtyReceived

The quantity of the PurchaseOrder line item received to date. In PO Item List: The item quantity received to date.In PO Totals and PO List: The total document quantity received to date.
IQBQuanType     Y

QtyReceivedRangeFilter

Searches for POs whose QtyReceived values fall within the specified range.
IQtyReceivedRangeFilter      

FromQtyReceived

Start of the QtyReceived range.
IQBQuanType     Y

ToQtyReceived

End of the QtyReceived range.
IQBQuanType     Y

ORSalesOrderNumberFilters

IORSalesOrderNumberFilters      

SalesOrderNumberFilter

Filters PurchaseOrders by the SalesOrder that generated them.
ISalesOrderNumberFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

SalesOrderNumber

This is a unique number automatically assigned to the SalesOrder at creation time by QBPOS. If a SalesOrder was used to generate a PurchaseOrder, the SalesOrderNumber is returned in the PurchaseOrder Ret object.
IQBStringType     Y

SalesOrderNumberRangeFilter

Filters PurchaseOrders by a range of SalesOrders.
ISalesOrderNumberRangeFilter      

FromSalesOrderNumber

Start of the range.
IQBStringType     Y

ToSalesOrderNumber

End of the range.
IQBStringType     Y

ORShipToStoreNumberFilters

IORShipToStoreNumberFilters   2.0  

ShipToStoreNumberFilter

Filters by the ShipToStoreNumber field value.
IShipToStoreNumberFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

ShipToStoreNumber

The store to which the item is to be shipped.
IQBIntType     Y

ShipToStoreNumberRangeFilter

Filters by a range of ShipToStoreNumber field values.
IShipToStoreNumberRangeFilter      

FromShipToStoreNumber

Start of the range of values.
IQBIntType     Y

ToShipToStoreNumber

End of the range of ShipToStoreNumber values.
IQBIntType     Y

ORStartShipDateFilters

IORStartShipDateFilters      

StartShipDateFilter

Searches for POs whose StartShip values match the specified filter.
IStartShipDateFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

StartShipDate

PO Ship Date: Enter the estimated shipping date for the order. Included on purchase journal and merchandise on-order reports.
IQBDateType     Y

StartShipDateRangeFilter

Searches for POs whose StartShip dates fall within the specified range.
IStartShipDateRangeFilter      

FromStartShipDate

Start of the StartShip range.
IQBDateType     Y

ToStartShipDate

End of the StartShip range.
IQBDateType     Y

StoreExchangeStatus

In multi store configurations, if the customer’s information has changed, this information is updated at the headquarters store. This response field indicates whether the information was successfully updated or not.
IQBENStoreExchangeStatusType      

ORStoreNumberFilters

IORStoreNumberFilters      

StoreNumberFilter

Available only for multi-store versions of QBPOS. Filters Quantity Adjustment Memos by the store number of the store originating the Quantity Adjustment Memo.
IStoreNumberFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

StoreNumber

This is used only for multi-store versions of QBPOS. The value is between 1 and 10, since a maximum of 10 stores are currently supported.
IQBIntType     Y

StoreNumberRangeFilter

Available only for multi-store versions of QBPOS. Filters Quantity Adjustment Memos by the specified range of store numbers of the store originating the Quantity Adjustment Memo.
IStoreNumberRangeFilter      

FromStoreNumber

Available for multi-store versions of QBPOS. Specifies the starting value of the Store Number range. Only memos whose Store Number value is at this value level or higher will be returned in the query.
IQBIntType     Y

ToStoreNumber

Specifies the ending value of the Store Number range. Only memos whose Store Number value falls between the FromStoreNumber value and this value will be returned in the query.
IQBIntType     Y

ORSubtotalFilters

IORSubtotalFilters      

SubtotalFilter

Filters vouchers by their Subtotal value.
ISubtotalFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

Subtotal

The total cost (sum of extended item costs) of the PO before applying any discounts or fees. This value is updated when a voucher that references the PO is updated.
IQBAmountType     Y

SubtotalRangeFilter

Filters vouchers by a range of Subtotal values.
ISubtotalRangeFilter      

FromSubtotal

Start of the Subtotal range.
IQBAmountType     Y

ToSubtotal

End of the Subtotal range.
IQBAmountType     Y

ORTermsDiscountFilters

IORTermsDiscountFilters   1.1  

TermsDiscountFilter

Filters by TermsDiscount.
ITermsDiscountFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TermsDiscount

The TermsDiscount field specifies the discount percentage. A discount is applied by the vendor if payment is received on or before the number of days specified in the TermsDiscountDays field for that vendor. Terms-related discounts for vendors are created or modified in the VendorAdd/VendorMod fields TermsDiscountDays and TermsDiscount.
IQBFloatType     Y

TermsDiscountRangeFilter

Filters by a range of TermsDiscount values.
ITermsDiscountRangeFilter      

FromTermsDiscount

Starting TermsDiscount value in the range of TermsDiscount values.
IQBFloatType     Y

ToTermsDiscount

Ending TermsDiscount value in the range of TermsDiscount values.
IQBFloatType     Y

ORTermsDiscountDaysFilters

IORTermsDiscountDaysFilters   1.1  

TermsDiscountDaysFilter

Filters by the TermsDiscountDays field.
ITermsDiscountDaysFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TermsDiscountDays

The TermsDiscountDays field specifies the number of days after the invoice date in which payment must be received in order to obtain the discount percentage. A discount is applied by the vendor if payment is received on or before the number of days specified in the TermsDiscountDays field for that vendor. Terms-related discounts for vendors are created or modified in the VendorAdd/VendorMod fields TermsDiscountDays and TermsDiscount.
IQBIntType     Y

TermsDiscountDaysRangeFilter

Filters by a range of TermsDiscountDays values.
ITermsDiscountDaysRangeFilter      

FromTermsDiscountDays

Starting TermsDiscountDays value in the range of TermsDiscountDays values.
IQBIntType     Y

ToTermsDiscountDays

Ending TermsDiscountDays value in the range of TermsDiscountDays values.
IQBIntType     Y

ORTermsNetDaysFilters

IORTermsNetDaysFilters   1.1  

TermsNetDaysFilter

Filters by the TermsNetDays field.
ITermsNetDaysFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TermsNetDays

This establishes the vendor’s payment due date, which is based on the vendor’s invoice date. The due date is established by the number of days specified in this field after the invoice date. Payment must be made within this number of days.
IQBIntType     Y

TermsNetDaysRangeFilter

Filters by a range of TermsNetDays values.
ITermsNetDaysRangeFilter      

FromTermsNetDays

Starting TermsNetDays value in the range of TermsNetDays values.
IQBIntType     Y

ToTermsNetDays

Ending TermsNetDays value in the range of TermsNetDays values.
IQBIntType     Y

ORTotalFilters

IORTotalFilters      

TotalFilter

Filters vouchers by their Total value.
ITotalFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

Total

The total PO amount after discounts and fees are applied.Total = Subtotal - Disc $ + Fee This value is updated when a voucher that references the PO is updated.
IQBAmountType     Y

TotalRangeFilter

Filters vouchers by a range of Total values.
ITotalRangeFilter      

FromTotal

Start of the Total range.
IQBAmountType     Y

ToTotal

End of the Total range.
IQBAmountType     Y

ORTxnDateFilters

IORTxnDateFilters      

TxnDateFilter

The ITxnDateFilter group object allows you to filter by transaction creation date.
ITxnDateFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TxnDate

The date of the transaction. In some cases, if you leave TxnDate out of an -Add message, QuickBooks will prefill TxnDate with the date of the last-saved transaction of the same type.
IQBDateType     Y

TxnDateRangeFilter

Filters according to the original transaction dates.
ITxnDateRangeFilter      

FromTxnDate

Selects transactions created on or after this date. Both FromTxnDate and ToTxnDate must be between 01/01/1901 and 12/31/9999.If you omit FromTxnDate, it will be set to 1970-01-01 (1969-12-31 PST).
IQBDateType     Y

ToTxnDate

Selects transactions created on or before this date. Both ToTxnDate and FromTxnDate must be between 01/01/1901 and 12/31/9999. If you omit ToTxnDate, it will be set to 2038-01-19 (2038-01-18 PST).
IQBDateType     Y

ORUnfilledPercentFilters

IORUnfilledPercentFilters      

UnfilledPercentFilter

Filters PurchaseOrders by their UnfilledPercent value.
IUnfilledPercentFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

UnfilledPercent

The percentage of the total PO quantity that has not yet been received. This value is updated when a voucher that references the PO is updated.
IQBFloatType     Y

UnfilledPercentRangeFilter

Filters PurchaseOrders by a range of UnfilledPercent values.
IUnfilledPercentRangeFilter      

FromUnfilledPercent

Start of the range.
IQBFloatType     Y

ToUnfilledPercent

End of the range.
IQBFloatType     Y

ORVendorCodeFilters

IORVendorCodeFilters      

VendorCodeFilter

Filters items by their Vendor Code values.
IVendorCodeFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

VendorCode

The code assigned to the vendor specified for the item.
IQBStringType 3 chars   Y

VendorCodeRangeFilter

Filters items by the specified range of Vendor Code values.
IVendorCodeRangeFilter      

FromVendorCode

Start of the Vendor Code range.
IQBStringType 3 chars   Y

ToVendorCode

End of the Vendor Code range.
IQBStringType 3 chars   Y

VendorListID

The listID of the vendor being referenced in this object reference.
IQBIDType      

IncludeRetElementList

You can use the IncludeRetElement feature to restrict the data returned in the response to the specified qbposXML field here. If you do this, only those elements specified will be returned. To use this feature, you simply add the qbposXML element name to the IncludeRetElementList. The following example shows how to do this, specifying that only the CreatedBy and ClockOutTime elements are to be returned in the TimeEntryAdd response: Dim MyTimeEntry As ITimeEntryAdd Set MyTimeEntry = requestMsgSet.AppendTimeEntryAddRq MyTimeEntry.IncludeRetElementList.Add “CreatedBy” MyTimeEntry.IncludeRetElementList.Add “ClockOutTime” ‘ set the other properties as desired…
IBSTRList 50 chars 2.0  
Tag Type Max length Implementation Required

IResponse

       

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

retCount

The retCount is returned in a query if in the query request you specified the metaData attribute with a value of MetaDataOnly (in which case the retCount is the only data returned in the query response) or MetaDataAndResponseData (the query response contains object data AND the approximate count). The retCount value contains the approximate count of the objects that could be expected to be returned from the query. A common use of this feature is to specify a count with no data in order to determine how many objects to expect from the actual query. You should be aware that the count returned in retCount is not guaranteed to be exact: it could be off slightly due to new object creation or deletions.
IQBIntType   4.0|us.png| Y

iteratorRemainingCount

This attribute is provided in the response in a query using iterators, indicating the number of objects remaining in the iteration. This can help you specify a MaxReturn value tailored to the number of objects still to be iterated through in your query.
IQBIntType   5.0|us.png| Y

iteratorID

The iterator query attribute is provided with most query types to allow you to break down query results into smaller and more manageable chunks of data. An iterator results in responses that contain only the specified number of objects. The iterator is created when a query contains the iterator attribute set to Start, along with a MaxReturn value specifying how many records are to be returned in each iteration. The response to that first query iteration contains, along with the response data, an IteratorID value that uniquely identifies that iterator. This is important because you can have many iterators active at the same time. Accordingly, in subsequent iterations of that query, you need to supply that returned iteratorID so the SDK knows where to resume the iteration.
IQBUUIDType   5.0|us.png| Y

Detail

IPurchaseOrderRetList      

(List of IPurchaseOrderRet Objects)

       

TxnID

QuickBooks generates a unique TxnID for each transaction that is added to QuickBooks. A TxnID returned from a request can be used to refer to the transaction in subsequent requests. Notice that you cannot supply the TxnID of a TimeTracking transaction to TransactionQueryRq requests. If you do, you get an error stating that no such record could be found, even though the transaction is in QuickBooks. This behavior reflects the behavior in the QuicKBooks UI in the Find window.
IQBIDType      

TimeCreated

The timestamp indicating the time when this object was created in QBPOS.
IQBDateTimeType   1.1  

TimeModified

The time when the object was modified by QBPOS.
IQBDateTimeType      

Associate

The employee making the adjustment transaction.
IQBStringType 40 chars    

CancelDate

Enter the date after which delivery may be refused. If the company preferences for receiving are set to check for cancel dates, the end user is alerted when receiving items against a PO past this cancel date. (That user can still accept the shipment at the user’s discretion.) If the company preferences for receiving are not set to check the Cancel date, the Cancel date is ignored.
IQBDateType      

CompanyName

The name of the business.
IQBStringType 41 chars    

Discount

Discount amount: Enter the amount of any discount applicable to the PO. Discounts are applied to the PO subtotal. Entering an amount causes the Disc % field to be automatically calculated.
IQBAmountType      

DiscountPercent

Enter a percentage discount applicable to the PO. Discounts are applied to the PO subtotal. Entering a discount percentage causes the Disc $ field to be automatically calculated.
IQBFloatType      

Fee

You can enter a fee using this field. Notice that Fees entered on a PO (such as a special handling fee) are not spread over the cost of individual items. When a receiving voucher references a PO with a fee entered, the fee can be transferred to the voucher at that point.
IQBAmountType      

Instructions

You can use this optional field to provide instructions to the vendor regarding the order. You can add up to two lines of text. This text prints on PurchaseOrders, but are not displayed on-screen.
IQBStringType 2000 chars    

ItemsCount

The number of line items in the adjustment add request that added the adjustment to QBPOS.
IQBIntType      

PurchaseOrderNumber

The number you want to assign to the purchase order. It should be unique. This number is automatically assigned to the PurchaseOrder by QBPOS if left empty during the creation process. An example of setting PO numbers is when you create a PO from a SalesOrder. You can use the SalesOrder number prefaced by PO, to show in the PO number the linkage between the sales order and the purchase order.
IQBStringType 20 chars    

PurchaseOrderStatusDesc

All PurchaseOrders have the status of either Open, Closed, or Custom. The Custom status is defined by the QBPOS user in Company Preferences for Purchasing. It has a user-specified description field.
IQBStringType      

QtyDue

In PO Item List: The item quantity remaining to be received.In PO Totals and PO List: The total document quantity remaining to be received. Updated by receiving vouchers. Qty Due = Qty Ordered – Qty Received.
IQBQuanType      

QtyOrdered

PO Totals and PO list: The total PO quantity ordered, combined for all items.
IQBQuanType      

QtyReceived

The quantity of the PurchaseOrder line item received to date. In PO Item List: The item quantity received to date.In PO Totals and PO List: The total document quantity received to date.
IQBQuanType      

SalesOrderNumber

This is a unique number automatically assigned to the SalesOrder at creation time by QBPOS. If a SalesOrder was used to generate a PurchaseOrder, the SalesOrderNumber is returned in the PurchaseOrder Ret object.
IQBStringType 32 chars    

ShipToStoreNumber

The store to which the item is to be shipped.
IQBIntType   2.0  

StartShipDate

PO Ship Date: Enter the estimated shipping date for the order. Included on purchase journal and merchandise on-order reports.
IQBDateType      

StoreExchangeStatus

In multi store configurations, if the customer’s information has changed, this information is updated at the headquarters store. This response field indicates whether the information was successfully updated or not.
IQBENStoreExchangeStatusType      

StoreNumber

This is used only for multi-store versions of QBPOS. The value is between 1 and 10, since a maximum of 10 stores are currently supported.
IQBIntType      

Subtotal

The total cost (sum of extended item costs) of the PO before applying any discounts or fees. This value is updated when a voucher that references the PO is updated.
IQBAmountType      

Terms

While not visible on the PO, any payment terms that are defined for the vendor file are carried to the PO and are available in this field in the returned PO object.
IQBStringType      

TermsDiscount

The TermsDiscount field specifies the discount percentage. A discount is applied by the vendor if payment is received on or before the number of days specified in the TermsDiscountDays field for that vendor. Terms-related discounts for vendors are created or modified in the VendorAdd/VendorMod fields TermsDiscountDays and TermsDiscount.
IQBFloatType   1.1  

TermsDiscountDays

The TermsDiscountDays field specifies the number of days after the invoice date in which payment must be received in order to obtain the discount percentage. A discount is applied by the vendor if payment is received on or before the number of days specified in the TermsDiscountDays field for that vendor. Terms-related discounts for vendors are created or modified in the VendorAdd/VendorMod fields TermsDiscountDays and TermsDiscount.
IQBIntType   1.1  

TermsNetDays

This establishes the vendor’s payment due date, which is based on the vendor’s invoice date. The due date is established by the number of days specified in this field after the invoice date. Payment must be made within this number of days.
IQBIntType   1.1  

Total

The total PO amount after discounts and fees are applied.Total = Subtotal - Disc $ + Fee This value is updated when a voucher that references the PO is updated.
IQBAmountType      

TxnDate

The date of the transaction. In some cases, if you leave TxnDate out of an -Add message, QuickBooks will prefill TxnDate with the date of the last-saved transaction of the same type.
IQBDateType      

UnfilledPercent

The percentage of the total PO quantity that has not yet been received. This value is updated when a voucher that references the PO is updated.
IQBFloatType      

VendorCode

The code assigned to the vendor specified for the item.
IQBStringType 3 chars    

VendorListID

The listID of the vendor being referenced in this object reference.
IQBIDType      

PurchaseOrderItemRetList

The list of PurchaseOrder line item objects returned in the response.
IPurchaseOrderItemRetList      

(List of IPurchaseOrderItemRet Objects)

       

ListID

The unique ID returned by QBPOS for this object. If supplied in a request, the ListID is a reference to an object required in the request. For example, in a SalesOrder or PurchaseOrder line item, the ListID that is required is an Item list ID.
IQBIDType      

TxnLineID

Identification number of the transaction line. (TxnLineID is supported as of v2.0 of the SDK. With qbXML v1.0 and v1.1, TxnLineID is always returned as zero.) If you need to add a new transaction line in a transaction Mod request, you can do so by setting the TxnLineID to -1.
IQBIntType      

ALU

Alternate Lookup. A user-defined identifier to be used to look up an item. Typically, this field contains such as the manufacturer’s part number, but it can contain any text descriptions, catalog numbers, etc. Duplicate Alternate Lookups are not allowed. Do not duplicate the Item # or UPC in this field. This will adversely affect performance for item lookups.
IQBStringType 20 chars    

Attribute

A field used to describe an item characteristic, typically color, pattern, material, or a second size. One to eight characters.
IQBStringType 12 chars    

Cost

The average cost of the item. Cost is automatically updated by receiving vouchers or manually updated by adjustment memos.
IQBAmountType      

Desc1

The principal item description field. This description is printed on receipts. For some versions of QBPOS, (Pro), this must be the same for all members of a style. Changes to this field can be applied to an item or to an entire style.
IQBStringType 30 chars    

Desc2

Secondary description field usually used for any additional information to describe this particular item, such as a vendor’s catalog number. Also can be used for additional information at the point of sale.
IQBStringType      

ExtendedCost

For a line item, Extended cost is the quantity ordered multiplied by the item cost.
IQBAmountType      

ItemNumber

Unique number assigned to the item when it is added to QBPOS.
IQBIntType      

NumberOfBaseUnits

If you use multiple units of measure, rather than a single UOM, you need to select one of the UOMs as the base unit. This base unit should be the smallest unit that you sell by. Inventory quantities are always expressed in terms of this base unit.
IQBQuanType   2.0  

Qty

The quantity of the line item being ordered or transferred.
IQBQuanType      

QtyReceived

The quantity of the PurchaseOrder line item received to date. In PO Item List: The item quantity received to date.In PO Totals and PO List: The total document quantity received to date.
IQBQuanType      

Size

The size of an item; 1 to 8 characters. This field can also be used to describe a second item attribute other than size if desired.
IQBStringType 12 chars    

UnitOfMeasure

If the company is using only a single unit of measure, this specifies the unit of measure for the item. If the company is using multiple units of measure, this specifies the base unit of measure for the item. Inventory quantities are tracked and reported in terms of this base unit.
IQBStringType 20 chars 2.0  

UPC

Universal Product Code. The item’s unique UPC/EAN/ISBN identifier. This field must be 13 characters. If a shorter number is entered, QBPOS uses an appropriate algorithm to lengthen the entry to fill the 13-character field.
IQBStringType 18 chars    

DataExtRetList

If you specify any custom fields/private data extensions to be returned in the query request (in the OwnerIDList), then this Ret List will contain all of the data extensions that belong to each specified OwnerID. For example, if you specify an OwnerID value of 0 (custom fields), then the query will return all custom data for the returned records.
IDataExtRetList   1.2  

(List of IDataExtRet Objects)

       

OwnerID

OwnerID refers to the owner of a data extension, and must be 0 or a valid GUID. (Custom fields, which are visible in the QuickBooks UI, always have an OwnerID of 0. ) Usually you would keep your application’s GUID confidential to prevent other applications from accessing your data extensions. But if you want to share data extensions with another application, the applications need to use the same GUID. In this case, each application could use two GUIDs, one for shared data extensions and one for confidential data extensions. (An application can have any number of GUIDs.) When you share a data extension with another application, the other application must know both the OwnerID and the DataExtName, as these together form a data extension’s unique name.
IQBGUIDType     Y

DataExtName

The name of the data extension. If this is a custom field, DataExtName will be visible as a label in the QuickBooks user interface. Also because OwnerID and DataExtName together make the data extension unique, and because custom fields all have the same OwnerID of zero, the DataExtName must be a unique value among existing custom fields. In contrast, the DataExtName for private data extensions must be unique only for the specified OwnerID GUID.
IQBStringType     Y

DataExtType

b>DataExtType The type of the data extension.
IQBENDataExtTypeType     Y

DataExtValue

The data in this field. The maximum length of DataExtValue will depend on the DataExtType of this data extension. For example, if DataExtType is STR255TYPE, the maximum length of DataExtValue is 255 characters. If DataExtType is STR1024TYPE, the maximum size of DataExtValue is 1KB.
IQBStringType     Y

  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
<?xml version="1.0" encoding="utf-8"?>
<?qbposxml version="4.0"?>
<QBPOSXML>
        <QBPOSXMLMsgsRq onError="stopOnError">
                <PurchaseOrderQueryRq metaData="ENUMTYPE" iterator="ENUMTYPE" iteratorID="UUIDTYPE">
                        <MaxReturned >INTTYPE</MaxReturned> <!-- optional -->
                        <OwnerID >GUIDTYPE</OwnerID> <!-- optional, may repeat -->
                        <TxnID >IDTYPE</TxnID> <!-- optional -->
                        <!-- BEGIN OR -->
                                <TimeCreatedFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TimeCreated >DATETIMETYPE</TimeCreated> <!-- required -->
                                </TimeCreatedFilter>
                        <!-- OR -->
                                <TimeCreatedRangeFilter> <!-- optional -->
                                        <FromTimeCreated >DATETIMETYPE</FromTimeCreated> <!-- required -->
                                        <ToTimeCreated >DATETIMETYPE</ToTimeCreated> <!-- required -->
                                </TimeCreatedRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TimeModifiedFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TimeModified >DATETIMETYPE</TimeModified> <!-- required -->
                                </TimeModifiedFilter>
                        <!-- OR -->
                                <TimeModifiedRangeFilter> <!-- optional -->
                                        <FromTimeModified >DATETIMETYPE</FromTimeModified> <!-- required -->
                                        <ToTimeModified >DATETIMETYPE</ToTimeModified> <!-- required -->
                                </TimeModifiedRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <AssociateFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <Associate >STRTYPE</Associate> <!-- required -->
                                </AssociateFilter>
                        <!-- OR -->
                                <AssociateRangeFilter> <!-- optional -->
                                        <FromAssociate >STRTYPE</FromAssociate> <!-- required -->
                                        <ToAssociate >STRTYPE</ToAssociate> <!-- required -->
                                </AssociateRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <CancelDateFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <CancelDate >DATETYPE</CancelDate> <!-- required -->
                                </CancelDateFilter>
                        <!-- OR -->
                                <CancelDateRangeFilter> <!-- optional -->
                                        <FromCancelDate >DATETYPE</FromCancelDate> <!-- required -->
                                        <ToCancelDate >DATETYPE</ToCancelDate> <!-- required -->
                                </CancelDateRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <CompanyNameFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <CompanyName >STRTYPE</CompanyName> <!-- required -->
                                </CompanyNameFilter>
                        <!-- OR -->
                                <CompanyNameRangeFilter> <!-- optional -->
                                        <FromCompanyName >STRTYPE</FromCompanyName> <!-- required -->
                                        <ToCompanyName >STRTYPE</ToCompanyName> <!-- required -->
                                </CompanyNameRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <DiscountFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <Discount >AMTTYPE</Discount> <!-- required -->
                                </DiscountFilter>
                        <!-- OR -->
                                <DiscountRangeFilter> <!-- optional -->
                                        <FromDiscount >AMTTYPE</FromDiscount> <!-- required -->
                                        <ToDiscount >AMTTYPE</ToDiscount> <!-- required -->
                                </DiscountRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <DiscountPercentFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <DiscountPercent >FLOATTYPE</DiscountPercent> <!-- required -->
                                </DiscountPercentFilter>
                        <!-- OR -->
                                <DiscountPercentRangeFilter> <!-- optional -->
                                        <FromDiscountPercent >FLOATTYPE</FromDiscountPercent> <!-- required -->
                                        <ToDiscountPercent >FLOATTYPE</ToDiscountPercent> <!-- required -->
                                </DiscountPercentRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <FeeFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <Fee >AMTTYPE</Fee> <!-- required -->
                                </FeeFilter>
                        <!-- OR -->
                                <FeeRangeFilter> <!-- optional -->
                                        <FromFee >AMTTYPE</FromFee> <!-- required -->
                                        <ToFee >AMTTYPE</ToFee> <!-- required -->
                                </FeeRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <InstructionsFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <Instructions >STRTYPE</Instructions> <!-- required -->
                                </InstructionsFilter>
                        <!-- OR -->
                                <InstructionsRangeFilter> <!-- optional -->
                                        <FromInstructions >STRTYPE</FromInstructions> <!-- required -->
                                        <ToInstructions >STRTYPE</ToInstructions> <!-- required -->
                                </InstructionsRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <ItemsCountFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <ItemsCount >INTTYPE</ItemsCount> <!-- required -->
                                </ItemsCountFilter>
                        <!-- OR -->
                                <ItemsCountRangeFilter> <!-- optional -->
                                        <FromItemsCount >INTTYPE</FromItemsCount> <!-- required -->
                                        <ToItemsCount >INTTYPE</ToItemsCount> <!-- required -->
                                </ItemsCountRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <PurchaseOrderNumberFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <PurchaseOrderNumber >STRTYPE</PurchaseOrderNumber> <!-- required -->
                                </PurchaseOrderNumberFilter>
                        <!-- OR -->
                                <PurchaseOrderNumberRangeFilter> <!-- optional -->
                                        <FromPurchaseOrderNumber >STRTYPE</FromPurchaseOrderNumber> <!-- required -->
                                        <ToPurchaseOrderNumber >STRTYPE</ToPurchaseOrderNumber> <!-- required -->
                                </PurchaseOrderNumberRangeFilter>
                        <!-- END OR -->
                        <PurchaseOrderStatusDesc >STRTYPE</PurchaseOrderStatusDesc> <!-- optional -->
                        <!-- BEGIN OR -->
                                <QtyOrderedFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <QtyOrdered >QUANTYPE</QtyOrdered> <!-- required -->
                                </QtyOrderedFilter>
                        <!-- OR -->
                                <QtyOrderedRangeFilter> <!-- optional -->
                                        <FromQtyOrdered >QUANTYPE</FromQtyOrdered> <!-- required -->
                                        <ToQtyOrdered >QUANTYPE</ToQtyOrdered> <!-- required -->
                                </QtyOrderedRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <QtyReceivedFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <QtyReceived >QUANTYPE</QtyReceived> <!-- required -->
                                </QtyReceivedFilter>
                        <!-- OR -->
                                <QtyReceivedRangeFilter> <!-- optional -->
                                        <FromQtyReceived >QUANTYPE</FromQtyReceived> <!-- required -->
                                        <ToQtyReceived >QUANTYPE</ToQtyReceived> <!-- required -->
                                </QtyReceivedRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <SalesOrderNumberFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <SalesOrderNumber >STRTYPE</SalesOrderNumber> <!-- required -->
                                </SalesOrderNumberFilter>
                        <!-- OR -->
                                <SalesOrderNumberRangeFilter> <!-- optional -->
                                        <FromSalesOrderNumber >STRTYPE</FromSalesOrderNumber> <!-- required -->
                                        <ToSalesOrderNumber >STRTYPE</ToSalesOrderNumber> <!-- required -->
                                </SalesOrderNumberRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <ShipToStoreNumberFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <ShipToStoreNumber >INTTYPE</ShipToStoreNumber> <!-- required -->
                                </ShipToStoreNumberFilter>
                        <!-- OR -->
                                <ShipToStoreNumberRangeFilter> <!-- optional -->
                                        <FromShipToStoreNumber >INTTYPE</FromShipToStoreNumber> <!-- required -->
                                        <ToShipToStoreNumber >INTTYPE</ToShipToStoreNumber> <!-- required -->
                                </ShipToStoreNumberRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <StartShipDateFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <StartShipDate >DATETYPE</StartShipDate> <!-- required -->
                                </StartShipDateFilter>
                        <!-- OR -->
                                <StartShipDateRangeFilter> <!-- optional -->
                                        <FromStartShipDate >DATETYPE</FromStartShipDate> <!-- required -->
                                        <ToStartShipDate >DATETYPE</ToStartShipDate> <!-- required -->
                                </StartShipDateRangeFilter>
                        <!-- END OR -->
                        <!-- StoreExchangeStatus may have one of the following values: Modified, Sent, Acknowledged -->
                        <StoreExchangeStatus >ENUMTYPE</StoreExchangeStatus> <!-- optional -->
                        <!-- BEGIN OR -->
                                <StoreNumberFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <StoreNumber >INTTYPE</StoreNumber> <!-- required -->
                                </StoreNumberFilter>
                        <!-- OR -->
                                <StoreNumberRangeFilter> <!-- optional -->
                                        <FromStoreNumber >INTTYPE</FromStoreNumber> <!-- required -->
                                        <ToStoreNumber >INTTYPE</ToStoreNumber> <!-- required -->
                                </StoreNumberRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <SubtotalFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <Subtotal >AMTTYPE</Subtotal> <!-- required -->
                                </SubtotalFilter>
                        <!-- OR -->
                                <SubtotalRangeFilter> <!-- optional -->
                                        <FromSubtotal >AMTTYPE</FromSubtotal> <!-- required -->
                                        <ToSubtotal >AMTTYPE</ToSubtotal> <!-- required -->
                                </SubtotalRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TermsDiscountFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TermsDiscount >FLOATTYPE</TermsDiscount> <!-- required -->
                                </TermsDiscountFilter>
                        <!-- OR -->
                                <TermsDiscountRangeFilter> <!-- optional -->
                                        <FromTermsDiscount >FLOATTYPE</FromTermsDiscount> <!-- required -->
                                        <ToTermsDiscount >FLOATTYPE</ToTermsDiscount> <!-- required -->
                                </TermsDiscountRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TermsDiscountDaysFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TermsDiscountDays >INTTYPE</TermsDiscountDays> <!-- required -->
                                </TermsDiscountDaysFilter>
                        <!-- OR -->
                                <TermsDiscountDaysRangeFilter> <!-- optional -->
                                        <FromTermsDiscountDays >INTTYPE</FromTermsDiscountDays> <!-- required -->
                                        <ToTermsDiscountDays >INTTYPE</ToTermsDiscountDays> <!-- required -->
                                </TermsDiscountDaysRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TermsNetDaysFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TermsNetDays >INTTYPE</TermsNetDays> <!-- required -->
                                </TermsNetDaysFilter>
                        <!-- OR -->
                                <TermsNetDaysRangeFilter> <!-- optional -->
                                        <FromTermsNetDays >INTTYPE</FromTermsNetDays> <!-- required -->
                                        <ToTermsNetDays >INTTYPE</ToTermsNetDays> <!-- required -->
                                </TermsNetDaysRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TotalFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <Total >AMTTYPE</Total> <!-- required -->
                                </TotalFilter>
                        <!-- OR -->
                                <TotalRangeFilter> <!-- optional -->
                                        <FromTotal >AMTTYPE</FromTotal> <!-- required -->
                                        <ToTotal >AMTTYPE</ToTotal> <!-- required -->
                                </TotalRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TxnDateFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TxnDate >DATETYPE</TxnDate> <!-- required -->
                                </TxnDateFilter>
                        <!-- OR -->
                                <TxnDateRangeFilter> <!-- optional -->
                                        <FromTxnDate >DATETYPE</FromTxnDate> <!-- required -->
                                        <ToTxnDate >DATETYPE</ToTxnDate> <!-- required -->
                                </TxnDateRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <UnfilledPercentFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <UnfilledPercent >FLOATTYPE</UnfilledPercent> <!-- required -->
                                </UnfilledPercentFilter>
                        <!-- OR -->
                                <UnfilledPercentRangeFilter> <!-- optional -->
                                        <FromUnfilledPercent >FLOATTYPE</FromUnfilledPercent> <!-- required -->
                                        <ToUnfilledPercent >FLOATTYPE</ToUnfilledPercent> <!-- required -->
                                </UnfilledPercentRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <VendorCodeFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <VendorCode >STRTYPE</VendorCode> <!-- required -->
                                </VendorCodeFilter>
                        <!-- OR -->
                                <VendorCodeRangeFilter> <!-- optional -->
                                        <FromVendorCode >STRTYPE</FromVendorCode> <!-- required -->
                                        <ToVendorCode >STRTYPE</ToVendorCode> <!-- required -->
                                </VendorCodeRangeFilter>
                        <!-- END OR -->
                        <VendorListID >IDTYPE</VendorListID> <!-- optional -->
                        <IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat -->
                </PurchaseOrderQueryRq>

                <PurchaseOrderQueryRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE" retCount="INTTYPE" iteratorRemainingCount="INTTYPE" iteratorID="UUIDTYPE">
                        <PurchaseOrderRet> <!-- optional, may repeat -->
                                <TxnID >IDTYPE</TxnID> <!-- optional -->
                                <TimeCreated >DATETIMETYPE</TimeCreated> <!-- optional -->
                                <TimeModified >DATETIMETYPE</TimeModified> <!-- optional -->
                                <Associate >STRTYPE</Associate> <!-- optional -->
                                <CancelDate >DATETYPE</CancelDate> <!-- optional -->
                                <CompanyName >STRTYPE</CompanyName> <!-- optional -->
                                <Discount >AMTTYPE</Discount> <!-- optional -->
                                <DiscountPercent >FLOATTYPE</DiscountPercent> <!-- optional -->
                                <Fee >AMTTYPE</Fee> <!-- optional -->
                                <Instructions >STRTYPE</Instructions> <!-- optional -->
                                <ItemsCount >INTTYPE</ItemsCount> <!-- optional -->
                                <PurchaseOrderNumber >STRTYPE</PurchaseOrderNumber> <!-- optional -->
                                <PurchaseOrderStatusDesc >STRTYPE</PurchaseOrderStatusDesc> <!-- optional -->
                                <QtyDue >QUANTYPE</QtyDue> <!-- optional -->
                                <QtyOrdered >QUANTYPE</QtyOrdered> <!-- optional -->
                                <QtyReceived >QUANTYPE</QtyReceived> <!-- optional -->
                                <SalesOrderNumber >STRTYPE</SalesOrderNumber> <!-- optional -->
                                <ShipToStoreNumber >INTTYPE</ShipToStoreNumber> <!-- optional -->
                                <StartShipDate >DATETYPE</StartShipDate> <!-- optional -->
                                <!-- StoreExchangeStatus may have one of the following values: Modified, Sent, Acknowledged -->
                                <StoreExchangeStatus >ENUMTYPE</StoreExchangeStatus> <!-- optional -->
                                <StoreNumber >INTTYPE</StoreNumber> <!-- optional -->
                                <Subtotal >AMTTYPE</Subtotal> <!-- optional -->
                                <Terms >STRTYPE</Terms> <!-- optional -->
                                <TermsDiscount >FLOATTYPE</TermsDiscount> <!-- optional -->
                                <TermsDiscountDays >INTTYPE</TermsDiscountDays> <!-- optional -->
                                <TermsNetDays >INTTYPE</TermsNetDays> <!-- optional -->
                                <Total >AMTTYPE</Total> <!-- optional -->
                                <TxnDate >DATETYPE</TxnDate> <!-- optional -->
                                <UnfilledPercent >FLOATTYPE</UnfilledPercent> <!-- optional -->
                                <VendorCode >STRTYPE</VendorCode> <!-- optional -->
                                <VendorListID >IDTYPE</VendorListID> <!-- optional -->
                                <PurchaseOrderItemRet> <!-- optional, may repeat -->
                                        <ListID >IDTYPE</ListID> <!-- optional -->
                                        <TxnLineID >INTTYPE</TxnLineID> <!-- optional -->
                                        <ALU >STRTYPE</ALU> <!-- optional -->
                                        <Attribute >STRTYPE</Attribute> <!-- optional -->
                                        <Cost >AMTTYPE</Cost> <!-- optional -->
                                        <Desc1 >STRTYPE</Desc1> <!-- optional -->
                                        <Desc2 >STRTYPE</Desc2> <!-- optional -->
                                        <ExtendedCost >AMTTYPE</ExtendedCost> <!-- optional -->
                                        <ItemNumber >INTTYPE</ItemNumber> <!-- optional -->
                                        <NumberOfBaseUnits >QUANTYPE</NumberOfBaseUnits> <!-- optional -->
                                        <Qty >QUANTYPE</Qty> <!-- optional -->
                                        <QtyReceived >QUANTYPE</QtyReceived> <!-- optional -->
                                        <Size >STRTYPE</Size> <!-- optional -->
                                        <UnitOfMeasure >STRTYPE</UnitOfMeasure> <!-- optional -->
                                        <UPC >STRTYPE</UPC> <!-- optional -->
                                </PurchaseOrderItemRet>
                                <DataExtRet> <!-- optional, may repeat -->
                                        <OwnerID >GUIDTYPE</OwnerID> <!-- required -->
                                        <DataExtName >STRTYPE</DataExtName> <!-- required -->
                                        <!-- DataExtType may have one of the following values: INTTYPE, AMTTYPE, PRICETYPE, QUANTYPE, PERCENTTYPE, DATETIMETYPE, STR255TYPE, STR1024TYPE -->
                                        <DataExtType >ENUMTYPE</DataExtType> <!-- required -->
                                        <DataExtValue >STRTYPE</DataExtValue> <!-- required -->
                                </DataExtRet>
                        </PurchaseOrderRet>
                </PurchaseOrderQueryRs>
        </QBPOSXMLMsgsRq>
</QBPOSXML>

  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
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
'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.qbposfc4

        Public Class SamplePurchaseOrderQuery
                Public Sub  DoPurchaseOrderQuery()
                        Dim sessionBegun as Boolean
                        sessionBegun = False
                        Dim connectionOpen as Boolean
                        connectionOpen = False
                        Dim sessionManager as QBPOSSessionManager
                        sessionManager = nothing

                        Try
                                'Create the session Manager object
                                sessionManager = new QBPOSSessionManager

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

                                BuildPurchaseOrderQueryRq(requestMsgSet)

                                'Connect to QuickBooks and begin a session
                                sessionManager.OpenConnection("","Sample Code from OSR")
                                connectionOpen = True
                                sessionManager.BeginSession("")
                                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

                                WalkPurchaseOrderQueryRs(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 BuildPurchaseOrderQueryRq(requestMsgSet as IMsgSetRequest)
                        Dim PurchaseOrderQueryRq as IPurchaseOrderQuery
                        PurchaseOrderQueryRq= requestMsgSet.AppendPurchaseOrderQueryRq()
                        'Set field value for MaxReturned
                        PurchaseOrderQueryRq.MaxReturned.SetValue(6)
                        'Set field value for OwnerIDList
                        'May create more than one of these if needed
                        PurchaseOrderQueryRq.OwnerIDList.Add(System.Guid.NewGuid().ToString())
                        'Set field value for TxnID
                        PurchaseOrderQueryRq.TxnID.SetValue("200000-1011023419")
                        Dim ORTimeCreatedFiltersElementType2861 as String
                        ORTimeCreatedFiltersElementType2861 = "TimeCreatedFilter"
                        if (ORTimeCreatedFiltersElementType2861 = "TimeCreatedFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTimeCreatedFilters.TimeCreatedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TimeCreated
                                PurchaseOrderQueryRq.ORTimeCreatedFilters.TimeCreatedFilter.TimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                        End If
                        if (ORTimeCreatedFiltersElementType2861 = "TimeCreatedRangeFilter") then
                                'Set field value for FromTimeCreated
                                PurchaseOrderQueryRq.ORTimeCreatedFilters.TimeCreatedRangeFilter.FromTimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                                'Set field value for ToTimeCreated
                                PurchaseOrderQueryRq.ORTimeCreatedFilters.TimeCreatedRangeFilter.ToTimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                        End If
                        Dim ORTimeModifiedFiltersElementType2862 as String
                        ORTimeModifiedFiltersElementType2862 = "TimeModifiedFilter"
                        if (ORTimeModifiedFiltersElementType2862 = "TimeModifiedFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTimeModifiedFilters.TimeModifiedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TimeModified
                                PurchaseOrderQueryRq.ORTimeModifiedFilters.TimeModifiedFilter.TimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                        End If
                        if (ORTimeModifiedFiltersElementType2862 = "TimeModifiedRangeFilter") then
                                'Set field value for FromTimeModified
                                PurchaseOrderQueryRq.ORTimeModifiedFilters.TimeModifiedRangeFilter.FromTimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                                'Set field value for ToTimeModified
                                PurchaseOrderQueryRq.ORTimeModifiedFilters.TimeModifiedRangeFilter.ToTimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                        End If
                        Dim ORAssociateFiltersElementType2863 as String
                        ORAssociateFiltersElementType2863 = "AssociateFilter"
                        if (ORAssociateFiltersElementType2863 = "AssociateFilter") then
                                'Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORAssociateFilters.AssociateFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for Associate
                                PurchaseOrderQueryRq.ORAssociateFilters.AssociateFilter.Associate.SetValue("ab")
                        End If
                        if (ORAssociateFiltersElementType2863 = "AssociateRangeFilter") then
                                'Set field value for FromAssociate
                                PurchaseOrderQueryRq.ORAssociateFilters.AssociateRangeFilter.FromAssociate.SetValue("ab")
                                'Set field value for ToAssociate
                                PurchaseOrderQueryRq.ORAssociateFilters.AssociateRangeFilter.ToAssociate.SetValue("ab")
                        End If
                        Dim ORCancelDateFiltersElementType2864 as String
                        ORCancelDateFiltersElementType2864 = "CancelDateFilter"
                        if (ORCancelDateFiltersElementType2864 = "CancelDateFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORCancelDateFilters.CancelDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for CancelDate
                                PurchaseOrderQueryRq.ORCancelDateFilters.CancelDateFilter.CancelDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        if (ORCancelDateFiltersElementType2864 = "CancelDateRangeFilter") then
                                'Set field value for FromCancelDate
                                PurchaseOrderQueryRq.ORCancelDateFilters.CancelDateRangeFilter.FromCancelDate.SetValue(DateTime.Parse("12/15/2007"))
                                'Set field value for ToCancelDate
                                PurchaseOrderQueryRq.ORCancelDateFilters.CancelDateRangeFilter.ToCancelDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        Dim ORCompanyNameFiltersElementType2865 as String
                        ORCompanyNameFiltersElementType2865 = "CompanyNameFilter"
                        if (ORCompanyNameFiltersElementType2865 = "CompanyNameFilter") then
                                'Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORCompanyNameFilters.CompanyNameFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for CompanyName
                                PurchaseOrderQueryRq.ORCompanyNameFilters.CompanyNameFilter.CompanyName.SetValue("ab")
                        End If
                        if (ORCompanyNameFiltersElementType2865 = "CompanyNameRangeFilter") then
                                'Set field value for FromCompanyName
                                PurchaseOrderQueryRq.ORCompanyNameFilters.CompanyNameRangeFilter.FromCompanyName.SetValue("ab")
                                'Set field value for ToCompanyName
                                PurchaseOrderQueryRq.ORCompanyNameFilters.CompanyNameRangeFilter.ToCompanyName.SetValue("ab")
                        End If
                        Dim ORDiscountFiltersElementType2866 as String
                        ORDiscountFiltersElementType2866 = "DiscountFilter"
                        if (ORDiscountFiltersElementType2866 = "DiscountFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORDiscountFilters.DiscountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for Discount
                                PurchaseOrderQueryRq.ORDiscountFilters.DiscountFilter.Discount.SetValue(10.01)
                        End If
                        if (ORDiscountFiltersElementType2866 = "DiscountRangeFilter") then
                                'Set field value for FromDiscount
                                PurchaseOrderQueryRq.ORDiscountFilters.DiscountRangeFilter.FromDiscount.SetValue(10.01)
                                'Set field value for ToDiscount
                                PurchaseOrderQueryRq.ORDiscountFilters.DiscountRangeFilter.ToDiscount.SetValue(10.01)
                        End If
                        Dim ORDiscountPercentFiltersElementType2867 as String
                        ORDiscountPercentFiltersElementType2867 = "DiscountPercentFilter"
                        if (ORDiscountPercentFiltersElementType2867 = "DiscountPercentFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORDiscountPercentFilters.DiscountPercentFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for DiscountPercent
                                PurchaseOrderQueryRq.ORDiscountPercentFilters.DiscountPercentFilter.DiscountPercent.SetValue(12.34)
                        End If
                        if (ORDiscountPercentFiltersElementType2867 = "DiscountPercentRangeFilter") then
                                'Set field value for FromDiscountPercent
                                PurchaseOrderQueryRq.ORDiscountPercentFilters.DiscountPercentRangeFilter.FromDiscountPercent.SetValue(12.34)
                                'Set field value for ToDiscountPercent
                                PurchaseOrderQueryRq.ORDiscountPercentFilters.DiscountPercentRangeFilter.ToDiscountPercent.SetValue(12.34)
                        End If
                        Dim ORFeeFiltersElementType2868 as String
                        ORFeeFiltersElementType2868 = "FeeFilter"
                        if (ORFeeFiltersElementType2868 = "FeeFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORFeeFilters.FeeFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for Fee
                                PurchaseOrderQueryRq.ORFeeFilters.FeeFilter.Fee.SetValue(10.01)
                        End If
                        if (ORFeeFiltersElementType2868 = "FeeRangeFilter") then
                                'Set field value for FromFee
                                PurchaseOrderQueryRq.ORFeeFilters.FeeRangeFilter.FromFee.SetValue(10.01)
                                'Set field value for ToFee
                                PurchaseOrderQueryRq.ORFeeFilters.FeeRangeFilter.ToFee.SetValue(10.01)
                        End If
                        Dim ORInstructionsFiltersElementType2869 as String
                        ORInstructionsFiltersElementType2869 = "InstructionsFilter"
                        if (ORInstructionsFiltersElementType2869 = "InstructionsFilter") then
                                'Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORInstructionsFilters.InstructionsFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for Instructions
                                PurchaseOrderQueryRq.ORInstructionsFilters.InstructionsFilter.Instructions.SetValue("ab")
                        End If
                        if (ORInstructionsFiltersElementType2869 = "InstructionsRangeFilter") then
                                'Set field value for FromInstructions
                                PurchaseOrderQueryRq.ORInstructionsFilters.InstructionsRangeFilter.FromInstructions.SetValue("ab")
                                'Set field value for ToInstructions
                                PurchaseOrderQueryRq.ORInstructionsFilters.InstructionsRangeFilter.ToInstructions.SetValue("ab")
                        End If
                        Dim ORItemsCountFiltersElementType2870 as String
                        ORItemsCountFiltersElementType2870 = "ItemsCountFilter"
                        if (ORItemsCountFiltersElementType2870 = "ItemsCountFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORItemsCountFilters.ItemsCountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for ItemsCount
                                PurchaseOrderQueryRq.ORItemsCountFilters.ItemsCountFilter.ItemsCount.SetValue(6)
                        End If
                        if (ORItemsCountFiltersElementType2870 = "ItemsCountRangeFilter") then
                                'Set field value for FromItemsCount
                                PurchaseOrderQueryRq.ORItemsCountFilters.ItemsCountRangeFilter.FromItemsCount.SetValue(6)
                                'Set field value for ToItemsCount
                                PurchaseOrderQueryRq.ORItemsCountFilters.ItemsCountRangeFilter.ToItemsCount.SetValue(6)
                        End If
                        Dim ORPurchaseOrderNumberFiltersElementType2871 as String
                        ORPurchaseOrderNumberFiltersElementType2871 = "PurchaseOrderNumberFilter"
                        if (ORPurchaseOrderNumberFiltersElementType2871 = "PurchaseOrderNumberFilter") then
                                'Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for PurchaseOrderNumber
                                PurchaseOrderQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberFilter.PurchaseOrderNumber.SetValue("ab")
                        End If
                        if (ORPurchaseOrderNumberFiltersElementType2871 = "PurchaseOrderNumberRangeFilter") then
                                'Set field value for FromPurchaseOrderNumber
                                PurchaseOrderQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberRangeFilter.FromPurchaseOrderNumber.SetValue("ab")
                                'Set field value for ToPurchaseOrderNumber
                                PurchaseOrderQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberRangeFilter.ToPurchaseOrderNumber.SetValue("ab")
                        End If
                        'Set field value for PurchaseOrderStatusDesc
                        PurchaseOrderQueryRq.PurchaseOrderStatusDesc.SetValue("ab")
                        Dim ORQtyOrderedFiltersElementType2872 as String
                        ORQtyOrderedFiltersElementType2872 = "QtyOrderedFilter"
                        if (ORQtyOrderedFiltersElementType2872 = "QtyOrderedFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORQtyOrderedFilters.QtyOrderedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for QtyOrdered
                                PurchaseOrderQueryRq.ORQtyOrderedFilters.QtyOrderedFilter.QtyOrdered.SetValue(2)
                        End If
                        if (ORQtyOrderedFiltersElementType2872 = "QtyOrderedRangeFilter") then
                                'Set field value for FromQtyOrdered
                                PurchaseOrderQueryRq.ORQtyOrderedFilters.QtyOrderedRangeFilter.FromQtyOrdered.SetValue(2)
                                'Set field value for ToQtyOrdered
                                PurchaseOrderQueryRq.ORQtyOrderedFilters.QtyOrderedRangeFilter.ToQtyOrdered.SetValue(2)
                        End If
                        Dim ORQtyReceivedFiltersElementType2873 as String
                        ORQtyReceivedFiltersElementType2873 = "QtyReceivedFilter"
                        if (ORQtyReceivedFiltersElementType2873 = "QtyReceivedFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORQtyReceivedFilters.QtyReceivedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for QtyReceived
                                PurchaseOrderQueryRq.ORQtyReceivedFilters.QtyReceivedFilter.QtyReceived.SetValue(2)
                        End If
                        if (ORQtyReceivedFiltersElementType2873 = "QtyReceivedRangeFilter") then
                                'Set field value for FromQtyReceived
                                PurchaseOrderQueryRq.ORQtyReceivedFilters.QtyReceivedRangeFilter.FromQtyReceived.SetValue(2)
                                'Set field value for ToQtyReceived
                                PurchaseOrderQueryRq.ORQtyReceivedFilters.QtyReceivedRangeFilter.ToQtyReceived.SetValue(2)
                        End If
                        Dim ORSalesOrderNumberFiltersElementType2874 as String
                        ORSalesOrderNumberFiltersElementType2874 = "SalesOrderNumberFilter"
                        if (ORSalesOrderNumberFiltersElementType2874 = "SalesOrderNumberFilter") then
                                'Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORSalesOrderNumberFilters.SalesOrderNumberFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for SalesOrderNumber
                                PurchaseOrderQueryRq.ORSalesOrderNumberFilters.SalesOrderNumberFilter.SalesOrderNumber.SetValue("ab")
                        End If
                        if (ORSalesOrderNumberFiltersElementType2874 = "SalesOrderNumberRangeFilter") then
                                'Set field value for FromSalesOrderNumber
                                PurchaseOrderQueryRq.ORSalesOrderNumberFilters.SalesOrderNumberRangeFilter.FromSalesOrderNumber.SetValue("ab")
                                'Set field value for ToSalesOrderNumber
                                PurchaseOrderQueryRq.ORSalesOrderNumberFilters.SalesOrderNumberRangeFilter.ToSalesOrderNumber.SetValue("ab")
                        End If
                        Dim ORShipToStoreNumberFiltersElementType2875 as String
                        ORShipToStoreNumberFiltersElementType2875 = "ShipToStoreNumberFilter"
                        if (ORShipToStoreNumberFiltersElementType2875 = "ShipToStoreNumberFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORShipToStoreNumberFilters.ShipToStoreNumberFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for ShipToStoreNumber
                                PurchaseOrderQueryRq.ORShipToStoreNumberFilters.ShipToStoreNumberFilter.ShipToStoreNumber.SetValue(6)
                        End If
                        if (ORShipToStoreNumberFiltersElementType2875 = "ShipToStoreNumberRangeFilter") then
                                'Set field value for FromShipToStoreNumber
                                PurchaseOrderQueryRq.ORShipToStoreNumberFilters.ShipToStoreNumberRangeFilter.FromShipToStoreNumber.SetValue(6)
                                'Set field value for ToShipToStoreNumber
                                PurchaseOrderQueryRq.ORShipToStoreNumberFilters.ShipToStoreNumberRangeFilter.ToShipToStoreNumber.SetValue(6)
                        End If
                        Dim ORStartShipDateFiltersElementType2876 as String
                        ORStartShipDateFiltersElementType2876 = "StartShipDateFilter"
                        if (ORStartShipDateFiltersElementType2876 = "StartShipDateFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORStartShipDateFilters.StartShipDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for StartShipDate
                                PurchaseOrderQueryRq.ORStartShipDateFilters.StartShipDateFilter.StartShipDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        if (ORStartShipDateFiltersElementType2876 = "StartShipDateRangeFilter") then
                                'Set field value for FromStartShipDate
                                PurchaseOrderQueryRq.ORStartShipDateFilters.StartShipDateRangeFilter.FromStartShipDate.SetValue(DateTime.Parse("12/15/2007"))
                                'Set field value for ToStartShipDate
                                PurchaseOrderQueryRq.ORStartShipDateFilters.StartShipDateRangeFilter.ToStartShipDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        'Set field value for StoreExchangeStatus
                        PurchaseOrderQueryRq.StoreExchangeStatus.SetValue(ENStoreExchangeStatus.sesModified)
                        Dim ORStoreNumberFiltersElementType2877 as String
                        ORStoreNumberFiltersElementType2877 = "StoreNumberFilter"
                        if (ORStoreNumberFiltersElementType2877 = "StoreNumberFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORStoreNumberFilters.StoreNumberFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for StoreNumber
                                PurchaseOrderQueryRq.ORStoreNumberFilters.StoreNumberFilter.StoreNumber.SetValue(6)
                        End If
                        if (ORStoreNumberFiltersElementType2877 = "StoreNumberRangeFilter") then
                                'Set field value for FromStoreNumber
                                PurchaseOrderQueryRq.ORStoreNumberFilters.StoreNumberRangeFilter.FromStoreNumber.SetValue(6)
                                'Set field value for ToStoreNumber
                                PurchaseOrderQueryRq.ORStoreNumberFilters.StoreNumberRangeFilter.ToStoreNumber.SetValue(6)
                        End If
                        Dim ORSubtotalFiltersElementType2878 as String
                        ORSubtotalFiltersElementType2878 = "SubtotalFilter"
                        if (ORSubtotalFiltersElementType2878 = "SubtotalFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORSubtotalFilters.SubtotalFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for Subtotal
                                PurchaseOrderQueryRq.ORSubtotalFilters.SubtotalFilter.Subtotal.SetValue(10.01)
                        End If
                        if (ORSubtotalFiltersElementType2878 = "SubtotalRangeFilter") then
                                'Set field value for FromSubtotal
                                PurchaseOrderQueryRq.ORSubtotalFilters.SubtotalRangeFilter.FromSubtotal.SetValue(10.01)
                                'Set field value for ToSubtotal
                                PurchaseOrderQueryRq.ORSubtotalFilters.SubtotalRangeFilter.ToSubtotal.SetValue(10.01)
                        End If
                        Dim ORTermsDiscountFiltersElementType2879 as String
                        ORTermsDiscountFiltersElementType2879 = "TermsDiscountFilter"
                        if (ORTermsDiscountFiltersElementType2879 = "TermsDiscountFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTermsDiscountFilters.TermsDiscountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TermsDiscount
                                PurchaseOrderQueryRq.ORTermsDiscountFilters.TermsDiscountFilter.TermsDiscount.SetValue(12.34)
                        End If
                        if (ORTermsDiscountFiltersElementType2879 = "TermsDiscountRangeFilter") then
                                'Set field value for FromTermsDiscount
                                PurchaseOrderQueryRq.ORTermsDiscountFilters.TermsDiscountRangeFilter.FromTermsDiscount.SetValue(12.34)
                                'Set field value for ToTermsDiscount
                                PurchaseOrderQueryRq.ORTermsDiscountFilters.TermsDiscountRangeFilter.ToTermsDiscount.SetValue(12.34)
                        End If
                        Dim ORTermsDiscountDaysFiltersElementType2880 as String
                        ORTermsDiscountDaysFiltersElementType2880 = "TermsDiscountDaysFilter"
                        if (ORTermsDiscountDaysFiltersElementType2880 = "TermsDiscountDaysFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TermsDiscountDays
                                PurchaseOrderQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysFilter.TermsDiscountDays.SetValue(6)
                        End If
                        if (ORTermsDiscountDaysFiltersElementType2880 = "TermsDiscountDaysRangeFilter") then
                                'Set field value for FromTermsDiscountDays
                                PurchaseOrderQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysRangeFilter.FromTermsDiscountDays.SetValue(6)
                                'Set field value for ToTermsDiscountDays
                                PurchaseOrderQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysRangeFilter.ToTermsDiscountDays.SetValue(6)
                        End If
                        Dim ORTermsNetDaysFiltersElementType2881 as String
                        ORTermsNetDaysFiltersElementType2881 = "TermsNetDaysFilter"
                        if (ORTermsNetDaysFiltersElementType2881 = "TermsNetDaysFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTermsNetDaysFilters.TermsNetDaysFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TermsNetDays
                                PurchaseOrderQueryRq.ORTermsNetDaysFilters.TermsNetDaysFilter.TermsNetDays.SetValue(6)
                        End If
                        if (ORTermsNetDaysFiltersElementType2881 = "TermsNetDaysRangeFilter") then
                                'Set field value for FromTermsNetDays
                                PurchaseOrderQueryRq.ORTermsNetDaysFilters.TermsNetDaysRangeFilter.FromTermsNetDays.SetValue(6)
                                'Set field value for ToTermsNetDays
                                PurchaseOrderQueryRq.ORTermsNetDaysFilters.TermsNetDaysRangeFilter.ToTermsNetDays.SetValue(6)
                        End If
                        Dim ORTotalFiltersElementType2882 as String
                        ORTotalFiltersElementType2882 = "TotalFilter"
                        if (ORTotalFiltersElementType2882 = "TotalFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTotalFilters.TotalFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for Total
                                PurchaseOrderQueryRq.ORTotalFilters.TotalFilter.Total.SetValue(10.01)
                        End If
                        if (ORTotalFiltersElementType2882 = "TotalRangeFilter") then
                                'Set field value for FromTotal
                                PurchaseOrderQueryRq.ORTotalFilters.TotalRangeFilter.FromTotal.SetValue(10.01)
                                'Set field value for ToTotal
                                PurchaseOrderQueryRq.ORTotalFilters.TotalRangeFilter.ToTotal.SetValue(10.01)
                        End If
                        Dim ORTxnDateFiltersElementType2883 as String
                        ORTxnDateFiltersElementType2883 = "TxnDateFilter"
                        if (ORTxnDateFiltersElementType2883 = "TxnDateFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTxnDateFilters.TxnDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TxnDate
                                PurchaseOrderQueryRq.ORTxnDateFilters.TxnDateFilter.TxnDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        if (ORTxnDateFiltersElementType2883 = "TxnDateRangeFilter") then
                                'Set field value for FromTxnDate
                                PurchaseOrderQueryRq.ORTxnDateFilters.TxnDateRangeFilter.FromTxnDate.SetValue(DateTime.Parse("12/15/2007"))
                                'Set field value for ToTxnDate
                                PurchaseOrderQueryRq.ORTxnDateFilters.TxnDateRangeFilter.ToTxnDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        Dim ORUnfilledPercentFiltersElementType2884 as String
                        ORUnfilledPercentFiltersElementType2884 = "UnfilledPercentFilter"
                        if (ORUnfilledPercentFiltersElementType2884 = "UnfilledPercentFilter") then
                                'Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORUnfilledPercentFilters.UnfilledPercentFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for UnfilledPercent
                                PurchaseOrderQueryRq.ORUnfilledPercentFilters.UnfilledPercentFilter.UnfilledPercent.SetValue(12.34)
                        End If
                        if (ORUnfilledPercentFiltersElementType2884 = "UnfilledPercentRangeFilter") then
                                'Set field value for FromUnfilledPercent
                                PurchaseOrderQueryRq.ORUnfilledPercentFilters.UnfilledPercentRangeFilter.FromUnfilledPercent.SetValue(12.34)
                                'Set field value for ToUnfilledPercent
                                PurchaseOrderQueryRq.ORUnfilledPercentFilters.UnfilledPercentRangeFilter.ToUnfilledPercent.SetValue(12.34)
                        End If
                        Dim ORVendorCodeFiltersElementType2885 as String
                        ORVendorCodeFiltersElementType2885 = "VendorCodeFilter"
                        if (ORVendorCodeFiltersElementType2885 = "VendorCodeFilter") then
                                'Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORVendorCodeFilters.VendorCodeFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for VendorCode
                                PurchaseOrderQueryRq.ORVendorCodeFilters.VendorCodeFilter.VendorCode.SetValue("ab")
                        End If
                        if (ORVendorCodeFiltersElementType2885 = "VendorCodeRangeFilter") then
                                'Set field value for FromVendorCode
                                PurchaseOrderQueryRq.ORVendorCodeFilters.VendorCodeRangeFilter.FromVendorCode.SetValue("ab")
                                'Set field value for ToVendorCode
                                PurchaseOrderQueryRq.ORVendorCodeFilters.VendorCodeRangeFilter.ToVendorCode.SetValue("ab")
                        End If
                        'Set field value for VendorListID
                        PurchaseOrderQueryRq.VendorListID.SetValue("200000-1011023419")
                        'Set field value for IncludeRetElementList
                        'May create more than one of these if needed
                        PurchaseOrderQueryRq.IncludeRetElementList.Add("ab")
                End Sub




                Public Sub WalkPurchaseOrderQueryRs( 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.rtPurchaseOrderQueryRs) then
                                                        'upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        Dim PurchaseOrderRet as IPurchaseOrderRetList
                                                        PurchaseOrderRet = CType(response.Detail,IPurchaseOrderRetList)
                                                        for z=0 to PurchaseOrderRet.Count-1
                                                                WalkPurchaseOrderRet(PurchaseOrderRet.GetAt(z))
                                                        Next z
                                                End If
                                        End If
                                End If
                        Next j
                End Sub




                Public Sub WalkPurchaseOrderRet(PurchaseOrderRet as IPurchaseOrderRet)
                        if (PurchaseOrderRet is nothing) then
                                Exit Sub
                        End If

                        'Go through all the elements of IPurchaseOrderRetList
                        'Get value of TxnID
                        if ( not PurchaseOrderRet.TxnID is nothing) then
                                Dim TxnID2886 as String
                                TxnID2886 = PurchaseOrderRet.TxnID.GetValue()
                        End If
                        'Get value of TimeCreated
                        if ( not PurchaseOrderRet.TimeCreated is nothing) then
                                Dim TimeCreated2887 as DateTime
                                TimeCreated2887 = PurchaseOrderRet.TimeCreated.GetValue()
                        End If
                        'Get value of TimeModified
                        if ( not PurchaseOrderRet.TimeModified is nothing) then
                                Dim TimeModified2888 as DateTime
                                TimeModified2888 = PurchaseOrderRet.TimeModified.GetValue()
                        End If
                        'Get value of Associate
                        if ( not PurchaseOrderRet.Associate is nothing) then
                                Dim Associate2889 as String
                                Associate2889 = PurchaseOrderRet.Associate.GetValue()
                        End If
                        'Get value of CancelDate
                        if ( not PurchaseOrderRet.CancelDate is nothing) then
                                Dim CancelDate2890 as DateTime
                                CancelDate2890 = PurchaseOrderRet.CancelDate.GetValue()
                        End If
                        'Get value of CompanyName
                        if ( not PurchaseOrderRet.CompanyName is nothing) then
                                Dim CompanyName2891 as String
                                CompanyName2891 = PurchaseOrderRet.CompanyName.GetValue()
                        End If
                        'Get value of Discount
                        if ( not PurchaseOrderRet.Discount is nothing) then
                                Dim Discount2892 as Double
                                Discount2892 = PurchaseOrderRet.Discount.GetValue()
                        End If
                        'Get value of DiscountPercent
                        if ( not PurchaseOrderRet.DiscountPercent is nothing) then
                                Dim DiscountPercent2893 as Single
                                DiscountPercent2893 = PurchaseOrderRet.DiscountPercent.GetValue()
                        End If
                        'Get value of Fee
                        if ( not PurchaseOrderRet.Fee is nothing) then
                                Dim Fee2894 as Double
                                Fee2894 = PurchaseOrderRet.Fee.GetValue()
                        End If
                        'Get value of Instructions
                        if ( not PurchaseOrderRet.Instructions is nothing) then
                                Dim Instructions2895 as String
                                Instructions2895 = PurchaseOrderRet.Instructions.GetValue()
                        End If
                        'Get value of ItemsCount
                        if ( not PurchaseOrderRet.ItemsCount is nothing) then
                                Dim ItemsCount2896 as Integer
                                ItemsCount2896 = PurchaseOrderRet.ItemsCount.GetValue()
                        End If
                        'Get value of PurchaseOrderNumber
                        if ( not PurchaseOrderRet.PurchaseOrderNumber is nothing) then
                                Dim PurchaseOrderNumber2897 as String
                                PurchaseOrderNumber2897 = PurchaseOrderRet.PurchaseOrderNumber.GetValue()
                        End If
                        'Get value of PurchaseOrderStatusDesc
                        if ( not PurchaseOrderRet.PurchaseOrderStatusDesc is nothing) then
                                Dim PurchaseOrderStatusDesc2898 as String
                                PurchaseOrderStatusDesc2898 = PurchaseOrderRet.PurchaseOrderStatusDesc.GetValue()
                        End If
                        'Get value of QtyDue
                        if ( not PurchaseOrderRet.QtyDue is nothing) then
                                Dim QtyDue2899 as Double
                                QtyDue2899 = PurchaseOrderRet.QtyDue.GetValue()
                        End If
                        'Get value of QtyOrdered
                        if ( not PurchaseOrderRet.QtyOrdered is nothing) then
                                Dim QtyOrdered2900 as Double
                                QtyOrdered2900 = PurchaseOrderRet.QtyOrdered.GetValue()
                        End If
                        'Get value of QtyReceived
                        if ( not PurchaseOrderRet.QtyReceived is nothing) then
                                Dim QtyReceived2901 as Double
                                QtyReceived2901 = PurchaseOrderRet.QtyReceived.GetValue()
                        End If
                        'Get value of SalesOrderNumber
                        if ( not PurchaseOrderRet.SalesOrderNumber is nothing) then
                                Dim SalesOrderNumber2902 as String
                                SalesOrderNumber2902 = PurchaseOrderRet.SalesOrderNumber.GetValue()
                        End If
                        'Get value of ShipToStoreNumber
                        if ( not PurchaseOrderRet.ShipToStoreNumber is nothing) then
                                Dim ShipToStoreNumber2903 as Integer
                                ShipToStoreNumber2903 = PurchaseOrderRet.ShipToStoreNumber.GetValue()
                        End If
                        'Get value of StartShipDate
                        if ( not PurchaseOrderRet.StartShipDate is nothing) then
                                Dim StartShipDate2904 as DateTime
                                StartShipDate2904 = PurchaseOrderRet.StartShipDate.GetValue()
                        End If
                        'Get value of StoreExchangeStatus
                        if ( not PurchaseOrderRet.StoreExchangeStatus is nothing) then
                                Dim StoreExchangeStatus2905 as ENStoreExchangeStatus
                                StoreExchangeStatus2905 = PurchaseOrderRet.StoreExchangeStatus.GetValue()
                        End If
                        'Get value of StoreNumber
                        if ( not PurchaseOrderRet.StoreNumber is nothing) then
                                Dim StoreNumber2906 as Integer
                                StoreNumber2906 = PurchaseOrderRet.StoreNumber.GetValue()
                        End If
                        'Get value of Subtotal
                        if ( not PurchaseOrderRet.Subtotal is nothing) then
                                Dim Subtotal2907 as Double
                                Subtotal2907 = PurchaseOrderRet.Subtotal.GetValue()
                        End If
                        'Get value of Terms
                        if ( not PurchaseOrderRet.Terms is nothing) then
                                Dim Terms2908 as String
                                Terms2908 = PurchaseOrderRet.Terms.GetValue()
                        End If
                        'Get value of TermsDiscount
                        if ( not PurchaseOrderRet.TermsDiscount is nothing) then
                                Dim TermsDiscount2909 as Single
                                TermsDiscount2909 = PurchaseOrderRet.TermsDiscount.GetValue()
                        End If
                        'Get value of TermsDiscountDays
                        if ( not PurchaseOrderRet.TermsDiscountDays is nothing) then
                                Dim TermsDiscountDays2910 as Integer
                                TermsDiscountDays2910 = PurchaseOrderRet.TermsDiscountDays.GetValue()
                        End If
                        'Get value of TermsNetDays
                        if ( not PurchaseOrderRet.TermsNetDays is nothing) then
                                Dim TermsNetDays2911 as Integer
                                TermsNetDays2911 = PurchaseOrderRet.TermsNetDays.GetValue()
                        End If
                        'Get value of Total
                        if ( not PurchaseOrderRet.Total is nothing) then
                                Dim Total2912 as Double
                                Total2912 = PurchaseOrderRet.Total.GetValue()
                        End If
                        'Get value of TxnDate
                        if ( not PurchaseOrderRet.TxnDate is nothing) then
                                Dim TxnDate2913 as DateTime
                                TxnDate2913 = PurchaseOrderRet.TxnDate.GetValue()
                        End If
                        'Get value of UnfilledPercent
                        if ( not PurchaseOrderRet.UnfilledPercent is nothing) then
                                Dim UnfilledPercent2914 as Single
                                UnfilledPercent2914 = PurchaseOrderRet.UnfilledPercent.GetValue()
                        End If
                        'Get value of VendorCode
                        if ( not PurchaseOrderRet.VendorCode is nothing) then
                                Dim VendorCode2915 as String
                                VendorCode2915 = PurchaseOrderRet.VendorCode.GetValue()
                        End If
                        'Get value of VendorListID
                        if ( not PurchaseOrderRet.VendorListID is nothing) then
                                Dim VendorListID2916 as String
                                VendorListID2916 = PurchaseOrderRet.VendorListID.GetValue()
                        End If
                        if (not PurchaseOrderRet.PurchaseOrderItemRetList is nothing)
                                Dim i2917 as Integer
                                for i2917 = 0  to PurchaseOrderRet.PurchaseOrderItemRetList.Count - 1
                                        Dim PurchaseOrderItemRet as IPurchaseOrderItemRet
                                        PurchaseOrderItemRet = PurchaseOrderRet.PurchaseOrderItemRetList.GetAt(i2917)
                                        'Get value of ListID
                                        if ( not PurchaseOrderItemRet.ListID is nothing) then
                                                Dim ListID2918 as String
                                                ListID2918 = PurchaseOrderItemRet.ListID.GetValue()
                                        End If
                                        'Get value of TxnLineID
                                        if ( not PurchaseOrderItemRet.TxnLineID is nothing) then
                                                Dim TxnLineID2919 as Integer
                                                TxnLineID2919 = PurchaseOrderItemRet.TxnLineID.GetValue()
                                        End If
                                        'Get value of ALU
                                        if ( not PurchaseOrderItemRet.ALU is nothing) then
                                                Dim ALU2920 as String
                                                ALU2920 = PurchaseOrderItemRet.ALU.GetValue()
                                        End If
                                        'Get value of Attribute
                                        if ( not PurchaseOrderItemRet.Attribute is nothing) then
                                                Dim Attribute2921 as String
                                                Attribute2921 = PurchaseOrderItemRet.Attribute.GetValue()
                                        End If
                                        'Get value of Cost
                                        if ( not PurchaseOrderItemRet.Cost is nothing) then
                                                Dim Cost2922 as Double
                                                Cost2922 = PurchaseOrderItemRet.Cost.GetValue()
                                        End If
                                        'Get value of Desc1
                                        if ( not PurchaseOrderItemRet.Desc1 is nothing) then
                                                Dim Desc12923 as String
                                                Desc12923 = PurchaseOrderItemRet.Desc1.GetValue()
                                        End If
                                        'Get value of Desc2
                                        if ( not PurchaseOrderItemRet.Desc2 is nothing) then
                                                Dim Desc22924 as String
                                                Desc22924 = PurchaseOrderItemRet.Desc2.GetValue()
                                        End If
                                        'Get value of ExtendedCost
                                        if ( not PurchaseOrderItemRet.ExtendedCost is nothing) then
                                                Dim ExtendedCost2925 as Double
                                                ExtendedCost2925 = PurchaseOrderItemRet.ExtendedCost.GetValue()
                                        End If
                                        'Get value of ItemNumber
                                        if ( not PurchaseOrderItemRet.ItemNumber is nothing) then
                                                Dim ItemNumber2926 as Integer
                                                ItemNumber2926 = PurchaseOrderItemRet.ItemNumber.GetValue()
                                        End If
                                        'Get value of NumberOfBaseUnits
                                        if ( not PurchaseOrderItemRet.NumberOfBaseUnits is nothing) then
                                                Dim NumberOfBaseUnits2927 as Double
                                                NumberOfBaseUnits2927 = PurchaseOrderItemRet.NumberOfBaseUnits.GetValue()
                                        End If
                                        'Get value of Qty
                                        if ( not PurchaseOrderItemRet.Qty is nothing) then
                                                Dim Qty2928 as Double
                                                Qty2928 = PurchaseOrderItemRet.Qty.GetValue()
                                        End If
                                        'Get value of QtyReceived
                                        if ( not PurchaseOrderItemRet.QtyReceived is nothing) then
                                                Dim QtyReceived2929 as Double
                                                QtyReceived2929 = PurchaseOrderItemRet.QtyReceived.GetValue()
                                        End If
                                        'Get value of Size
                                        if ( not PurchaseOrderItemRet.Size is nothing) then
                                                Dim Size2930 as String
                                                Size2930 = PurchaseOrderItemRet.Size.GetValue()
                                        End If
                                        'Get value of UnitOfMeasure
                                        if ( not PurchaseOrderItemRet.UnitOfMeasure is nothing) then
                                                Dim UnitOfMeasure2931 as String
                                                UnitOfMeasure2931 = PurchaseOrderItemRet.UnitOfMeasure.GetValue()
                                        End If
                                        'Get value of UPC
                                        if ( not PurchaseOrderItemRet.UPC is nothing) then
                                                Dim UPC2932 as String
                                                UPC2932 = PurchaseOrderItemRet.UPC.GetValue()
                                        End If
                                Next i2917
                        End If
                        if (not PurchaseOrderRet.DataExtRetList is nothing)
                                Dim i2933 as Integer
                                for i2933 = 0  to PurchaseOrderRet.DataExtRetList.Count - 1
                                        Dim DataExtRet as IDataExtRet
                                        DataExtRet = PurchaseOrderRet.DataExtRetList.GetAt(i2933)
                                        'Get value of OwnerID
                                        Dim OwnerID2934 as String
                                        OwnerID2934 = DataExtRet.OwnerID.GetValue()
                                        'Get value of DataExtName
                                        Dim DataExtName2935 as String
                                        DataExtName2935 = DataExtRet.DataExtName.GetValue()
                                        'Get value of DataExtType
                                        Dim DataExtType2936 as ENDataExtType
                                        DataExtType2936 = DataExtRet.DataExtType.GetValue()
                                        'Get value of DataExtValue
                                        Dim DataExtValue2937 as String
                                        DataExtValue2937 = DataExtRet.DataExtValue.GetValue()
                                Next i2933
                        End If
                End Sub




        End Class

  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
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
//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.qbposfc4;

namespace com.intuit.idn.samples
{
        public class SamplePurchaseOrderQuery
        {
                public void  DoPurchaseOrderQuery()
                {
                        bool sessionBegun = false;
                        bool connectionOpen = false;
                        QBPOSSessionManager sessionManager = null;

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

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

                                BuildPurchaseOrderQueryRq(requestMsgSet);

                                //Connect to QuickBooks and begin a session
                                sessionManager.OpenConnection("","Sample Code from OSR");
                                connectionOpen = true;
                                sessionManager.BeginSession("");
                                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;

                                WalkPurchaseOrderQueryRs(responseMsgSet);
                        }
                        catch (Exception e)
                        {
                                MessageBox.Show(e.Message, "Error");
                                if (sessionBegun)
                                {
                                        sessionManager.EndSession();
                                }
                                if (connectionOpen)
                                {
                                        sessionManager.CloseConnection();
                                }
                        }
                }
                void BuildPurchaseOrderQueryRq(IMsgSetRequest requestMsgSet)
                {
                        IPurchaseOrderQuery PurchaseOrderQueryRq= requestMsgSet.AppendPurchaseOrderQueryRq();
                        //Set attributes
                        //Set field value for metaData
                        PurchaseOrderQueryRq.metaData.SetValue(ENmetaData.mdMetaDataAndResponseData);
                        //Set field value for iterator
                        PurchaseOrderQueryRq.iterator.SetValue(ENiterator.itStart);
                        //Set field value for iteratorID
                        PurchaseOrderQueryRq.iteratorID.SetValue("{D7355385-A17B-4f5d-B34D-F34C79C3E6FC}");
                        //Set field value for MaxReturned
                        PurchaseOrderQueryRq.MaxReturned.SetValue(6);
                        //Set field value for OwnerIDList
                        //May create more than one of these if needed
                        PurchaseOrderQueryRq.OwnerIDList.Add(Guid.NewGuid().ToString());
                        //Set field value for TxnID
                        PurchaseOrderQueryRq.TxnID.SetValue("200000-1011023419");
                        string ORTimeCreatedFiltersElementType2938 = "TimeCreatedFilter";
                        if (ORTimeCreatedFiltersElementType2938 == "TimeCreatedFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTimeCreatedFilters.TimeCreatedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TimeCreated
                                PurchaseOrderQueryRq.ORTimeCreatedFilters.TimeCreatedFilter.TimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                        }
                        if (ORTimeCreatedFiltersElementType2938 == "TimeCreatedRangeFilter")
                        {
                                //Set field value for FromTimeCreated
                                PurchaseOrderQueryRq.ORTimeCreatedFilters.TimeCreatedRangeFilter.FromTimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                                //Set field value for ToTimeCreated
                                PurchaseOrderQueryRq.ORTimeCreatedFilters.TimeCreatedRangeFilter.ToTimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                        }
                        string ORTimeModifiedFiltersElementType2939 = "TimeModifiedFilter";
                        if (ORTimeModifiedFiltersElementType2939 == "TimeModifiedFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTimeModifiedFilters.TimeModifiedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TimeModified
                                PurchaseOrderQueryRq.ORTimeModifiedFilters.TimeModifiedFilter.TimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                        }
                        if (ORTimeModifiedFiltersElementType2939 == "TimeModifiedRangeFilter")
                        {
                                //Set field value for FromTimeModified
                                PurchaseOrderQueryRq.ORTimeModifiedFilters.TimeModifiedRangeFilter.FromTimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                                //Set field value for ToTimeModified
                                PurchaseOrderQueryRq.ORTimeModifiedFilters.TimeModifiedRangeFilter.ToTimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                        }
                        string ORAssociateFiltersElementType2940 = "AssociateFilter";
                        if (ORAssociateFiltersElementType2940 == "AssociateFilter")
                        {
                                //Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORAssociateFilters.AssociateFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for Associate
                                PurchaseOrderQueryRq.ORAssociateFilters.AssociateFilter.Associate.SetValue("ab");
                        }
                        if (ORAssociateFiltersElementType2940 == "AssociateRangeFilter")
                        {
                                //Set field value for FromAssociate
                                PurchaseOrderQueryRq.ORAssociateFilters.AssociateRangeFilter.FromAssociate.SetValue("ab");
                                //Set field value for ToAssociate
                                PurchaseOrderQueryRq.ORAssociateFilters.AssociateRangeFilter.ToAssociate.SetValue("ab");
                        }
                        string ORCancelDateFiltersElementType2941 = "CancelDateFilter";
                        if (ORCancelDateFiltersElementType2941 == "CancelDateFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORCancelDateFilters.CancelDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for CancelDate
                                PurchaseOrderQueryRq.ORCancelDateFilters.CancelDateFilter.CancelDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        if (ORCancelDateFiltersElementType2941 == "CancelDateRangeFilter")
                        {
                                //Set field value for FromCancelDate
                                PurchaseOrderQueryRq.ORCancelDateFilters.CancelDateRangeFilter.FromCancelDate.SetValue(DateTime.Parse("12/15/2007"));
                                //Set field value for ToCancelDate
                                PurchaseOrderQueryRq.ORCancelDateFilters.CancelDateRangeFilter.ToCancelDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        string ORCompanyNameFiltersElementType2942 = "CompanyNameFilter";
                        if (ORCompanyNameFiltersElementType2942 == "CompanyNameFilter")
                        {
                                //Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORCompanyNameFilters.CompanyNameFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for CompanyName
                                PurchaseOrderQueryRq.ORCompanyNameFilters.CompanyNameFilter.CompanyName.SetValue("ab");
                        }
                        if (ORCompanyNameFiltersElementType2942 == "CompanyNameRangeFilter")
                        {
                                //Set field value for FromCompanyName
                                PurchaseOrderQueryRq.ORCompanyNameFilters.CompanyNameRangeFilter.FromCompanyName.SetValue("ab");
                                //Set field value for ToCompanyName
                                PurchaseOrderQueryRq.ORCompanyNameFilters.CompanyNameRangeFilter.ToCompanyName.SetValue("ab");
                        }
                        string ORDiscountFiltersElementType2943 = "DiscountFilter";
                        if (ORDiscountFiltersElementType2943 == "DiscountFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORDiscountFilters.DiscountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for Discount
                                PurchaseOrderQueryRq.ORDiscountFilters.DiscountFilter.Discount.SetValue(10.01);
                        }
                        if (ORDiscountFiltersElementType2943 == "DiscountRangeFilter")
                        {
                                //Set field value for FromDiscount
                                PurchaseOrderQueryRq.ORDiscountFilters.DiscountRangeFilter.FromDiscount.SetValue(10.01);
                                //Set field value for ToDiscount
                                PurchaseOrderQueryRq.ORDiscountFilters.DiscountRangeFilter.ToDiscount.SetValue(10.01);
                        }
                        string ORDiscountPercentFiltersElementType2944 = "DiscountPercentFilter";
                        if (ORDiscountPercentFiltersElementType2944 == "DiscountPercentFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORDiscountPercentFilters.DiscountPercentFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for DiscountPercent
                                PurchaseOrderQueryRq.ORDiscountPercentFilters.DiscountPercentFilter.DiscountPercent.SetValue(12.34F);
                        }
                        if (ORDiscountPercentFiltersElementType2944 == "DiscountPercentRangeFilter")
                        {
                                //Set field value for FromDiscountPercent
                                PurchaseOrderQueryRq.ORDiscountPercentFilters.DiscountPercentRangeFilter.FromDiscountPercent.SetValue(12.34F);
                                //Set field value for ToDiscountPercent
                                PurchaseOrderQueryRq.ORDiscountPercentFilters.DiscountPercentRangeFilter.ToDiscountPercent.SetValue(12.34F);
                        }
                        string ORFeeFiltersElementType2945 = "FeeFilter";
                        if (ORFeeFiltersElementType2945 == "FeeFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORFeeFilters.FeeFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for Fee
                                PurchaseOrderQueryRq.ORFeeFilters.FeeFilter.Fee.SetValue(10.01);
                        }
                        if (ORFeeFiltersElementType2945 == "FeeRangeFilter")
                        {
                                //Set field value for FromFee
                                PurchaseOrderQueryRq.ORFeeFilters.FeeRangeFilter.FromFee.SetValue(10.01);
                                //Set field value for ToFee
                                PurchaseOrderQueryRq.ORFeeFilters.FeeRangeFilter.ToFee.SetValue(10.01);
                        }
                        string ORInstructionsFiltersElementType2946 = "InstructionsFilter";
                        if (ORInstructionsFiltersElementType2946 == "InstructionsFilter")
                        {
                                //Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORInstructionsFilters.InstructionsFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for Instructions
                                PurchaseOrderQueryRq.ORInstructionsFilters.InstructionsFilter.Instructions.SetValue("ab");
                        }
                        if (ORInstructionsFiltersElementType2946 == "InstructionsRangeFilter")
                        {
                                //Set field value for FromInstructions
                                PurchaseOrderQueryRq.ORInstructionsFilters.InstructionsRangeFilter.FromInstructions.SetValue("ab");
                                //Set field value for ToInstructions
                                PurchaseOrderQueryRq.ORInstructionsFilters.InstructionsRangeFilter.ToInstructions.SetValue("ab");
                        }
                        string ORItemsCountFiltersElementType2947 = "ItemsCountFilter";
                        if (ORItemsCountFiltersElementType2947 == "ItemsCountFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORItemsCountFilters.ItemsCountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for ItemsCount
                                PurchaseOrderQueryRq.ORItemsCountFilters.ItemsCountFilter.ItemsCount.SetValue(6);
                        }
                        if (ORItemsCountFiltersElementType2947 == "ItemsCountRangeFilter")
                        {
                                //Set field value for FromItemsCount
                                PurchaseOrderQueryRq.ORItemsCountFilters.ItemsCountRangeFilter.FromItemsCount.SetValue(6);
                                //Set field value for ToItemsCount
                                PurchaseOrderQueryRq.ORItemsCountFilters.ItemsCountRangeFilter.ToItemsCount.SetValue(6);
                        }
                        string ORPurchaseOrderNumberFiltersElementType2948 = "PurchaseOrderNumberFilter";
                        if (ORPurchaseOrderNumberFiltersElementType2948 == "PurchaseOrderNumberFilter")
                        {
                                //Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for PurchaseOrderNumber
                                PurchaseOrderQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberFilter.PurchaseOrderNumber.SetValue("ab");
                        }
                        if (ORPurchaseOrderNumberFiltersElementType2948 == "PurchaseOrderNumberRangeFilter")
                        {
                                //Set field value for FromPurchaseOrderNumber
                                PurchaseOrderQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberRangeFilter.FromPurchaseOrderNumber.SetValue("ab");
                                //Set field value for ToPurchaseOrderNumber
                                PurchaseOrderQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberRangeFilter.ToPurchaseOrderNumber.SetValue("ab");
                        }
                        //Set field value for PurchaseOrderStatusDesc
                        PurchaseOrderQueryRq.PurchaseOrderStatusDesc.SetValue("ab");
                        string ORQtyOrderedFiltersElementType2949 = "QtyOrderedFilter";
                        if (ORQtyOrderedFiltersElementType2949 == "QtyOrderedFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORQtyOrderedFilters.QtyOrderedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for QtyOrdered
                                PurchaseOrderQueryRq.ORQtyOrderedFilters.QtyOrderedFilter.QtyOrdered.SetValue(2);
                        }
                        if (ORQtyOrderedFiltersElementType2949 == "QtyOrderedRangeFilter")
                        {
                                //Set field value for FromQtyOrdered
                                PurchaseOrderQueryRq.ORQtyOrderedFilters.QtyOrderedRangeFilter.FromQtyOrdered.SetValue(2);
                                //Set field value for ToQtyOrdered
                                PurchaseOrderQueryRq.ORQtyOrderedFilters.QtyOrderedRangeFilter.ToQtyOrdered.SetValue(2);
                        }
                        string ORQtyReceivedFiltersElementType2950 = "QtyReceivedFilter";
                        if (ORQtyReceivedFiltersElementType2950 == "QtyReceivedFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORQtyReceivedFilters.QtyReceivedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for QtyReceived
                                PurchaseOrderQueryRq.ORQtyReceivedFilters.QtyReceivedFilter.QtyReceived.SetValue(2);
                        }
                        if (ORQtyReceivedFiltersElementType2950 == "QtyReceivedRangeFilter")
                        {
                                //Set field value for FromQtyReceived
                                PurchaseOrderQueryRq.ORQtyReceivedFilters.QtyReceivedRangeFilter.FromQtyReceived.SetValue(2);
                                //Set field value for ToQtyReceived
                                PurchaseOrderQueryRq.ORQtyReceivedFilters.QtyReceivedRangeFilter.ToQtyReceived.SetValue(2);
                        }
                        string ORSalesOrderNumberFiltersElementType2951 = "SalesOrderNumberFilter";
                        if (ORSalesOrderNumberFiltersElementType2951 == "SalesOrderNumberFilter")
                        {
                                //Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORSalesOrderNumberFilters.SalesOrderNumberFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for SalesOrderNumber
                                PurchaseOrderQueryRq.ORSalesOrderNumberFilters.SalesOrderNumberFilter.SalesOrderNumber.SetValue("ab");
                        }
                        if (ORSalesOrderNumberFiltersElementType2951 == "SalesOrderNumberRangeFilter")
                        {
                                //Set field value for FromSalesOrderNumber
                                PurchaseOrderQueryRq.ORSalesOrderNumberFilters.SalesOrderNumberRangeFilter.FromSalesOrderNumber.SetValue("ab");
                                //Set field value for ToSalesOrderNumber
                                PurchaseOrderQueryRq.ORSalesOrderNumberFilters.SalesOrderNumberRangeFilter.ToSalesOrderNumber.SetValue("ab");
                        }
                        string ORShipToStoreNumberFiltersElementType2952 = "ShipToStoreNumberFilter";
                        if (ORShipToStoreNumberFiltersElementType2952 == "ShipToStoreNumberFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORShipToStoreNumberFilters.ShipToStoreNumberFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for ShipToStoreNumber
                                PurchaseOrderQueryRq.ORShipToStoreNumberFilters.ShipToStoreNumberFilter.ShipToStoreNumber.SetValue(6);
                        }
                        if (ORShipToStoreNumberFiltersElementType2952 == "ShipToStoreNumberRangeFilter")
                        {
                                //Set field value for FromShipToStoreNumber
                                PurchaseOrderQueryRq.ORShipToStoreNumberFilters.ShipToStoreNumberRangeFilter.FromShipToStoreNumber.SetValue(6);
                                //Set field value for ToShipToStoreNumber
                                PurchaseOrderQueryRq.ORShipToStoreNumberFilters.ShipToStoreNumberRangeFilter.ToShipToStoreNumber.SetValue(6);
                        }
                        string ORStartShipDateFiltersElementType2953 = "StartShipDateFilter";
                        if (ORStartShipDateFiltersElementType2953 == "StartShipDateFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORStartShipDateFilters.StartShipDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for StartShipDate
                                PurchaseOrderQueryRq.ORStartShipDateFilters.StartShipDateFilter.StartShipDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        if (ORStartShipDateFiltersElementType2953 == "StartShipDateRangeFilter")
                        {
                                //Set field value for FromStartShipDate
                                PurchaseOrderQueryRq.ORStartShipDateFilters.StartShipDateRangeFilter.FromStartShipDate.SetValue(DateTime.Parse("12/15/2007"));
                                //Set field value for ToStartShipDate
                                PurchaseOrderQueryRq.ORStartShipDateFilters.StartShipDateRangeFilter.ToStartShipDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        //Set field value for StoreExchangeStatus
                        PurchaseOrderQueryRq.StoreExchangeStatus.SetValue(ENStoreExchangeStatus.sesModified);
                        string ORStoreNumberFiltersElementType2954 = "StoreNumberFilter";
                        if (ORStoreNumberFiltersElementType2954 == "StoreNumberFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORStoreNumberFilters.StoreNumberFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for StoreNumber
                                PurchaseOrderQueryRq.ORStoreNumberFilters.StoreNumberFilter.StoreNumber.SetValue(6);
                        }
                        if (ORStoreNumberFiltersElementType2954 == "StoreNumberRangeFilter")
                        {
                                //Set field value for FromStoreNumber
                                PurchaseOrderQueryRq.ORStoreNumberFilters.StoreNumberRangeFilter.FromStoreNumber.SetValue(6);
                                //Set field value for ToStoreNumber
                                PurchaseOrderQueryRq.ORStoreNumberFilters.StoreNumberRangeFilter.ToStoreNumber.SetValue(6);
                        }
                        string ORSubtotalFiltersElementType2955 = "SubtotalFilter";
                        if (ORSubtotalFiltersElementType2955 == "SubtotalFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORSubtotalFilters.SubtotalFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for Subtotal
                                PurchaseOrderQueryRq.ORSubtotalFilters.SubtotalFilter.Subtotal.SetValue(10.01);
                        }
                        if (ORSubtotalFiltersElementType2955 == "SubtotalRangeFilter")
                        {
                                //Set field value for FromSubtotal
                                PurchaseOrderQueryRq.ORSubtotalFilters.SubtotalRangeFilter.FromSubtotal.SetValue(10.01);
                                //Set field value for ToSubtotal
                                PurchaseOrderQueryRq.ORSubtotalFilters.SubtotalRangeFilter.ToSubtotal.SetValue(10.01);
                        }
                        string ORTermsDiscountFiltersElementType2956 = "TermsDiscountFilter";
                        if (ORTermsDiscountFiltersElementType2956 == "TermsDiscountFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTermsDiscountFilters.TermsDiscountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TermsDiscount
                                PurchaseOrderQueryRq.ORTermsDiscountFilters.TermsDiscountFilter.TermsDiscount.SetValue(12.34F);
                        }
                        if (ORTermsDiscountFiltersElementType2956 == "TermsDiscountRangeFilter")
                        {
                                //Set field value for FromTermsDiscount
                                PurchaseOrderQueryRq.ORTermsDiscountFilters.TermsDiscountRangeFilter.FromTermsDiscount.SetValue(12.34F);
                                //Set field value for ToTermsDiscount
                                PurchaseOrderQueryRq.ORTermsDiscountFilters.TermsDiscountRangeFilter.ToTermsDiscount.SetValue(12.34F);
                        }
                        string ORTermsDiscountDaysFiltersElementType2957 = "TermsDiscountDaysFilter";
                        if (ORTermsDiscountDaysFiltersElementType2957 == "TermsDiscountDaysFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TermsDiscountDays
                                PurchaseOrderQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysFilter.TermsDiscountDays.SetValue(6);
                        }
                        if (ORTermsDiscountDaysFiltersElementType2957 == "TermsDiscountDaysRangeFilter")
                        {
                                //Set field value for FromTermsDiscountDays
                                PurchaseOrderQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysRangeFilter.FromTermsDiscountDays.SetValue(6);
                                //Set field value for ToTermsDiscountDays
                                PurchaseOrderQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysRangeFilter.ToTermsDiscountDays.SetValue(6);
                        }
                        string ORTermsNetDaysFiltersElementType2958 = "TermsNetDaysFilter";
                        if (ORTermsNetDaysFiltersElementType2958 == "TermsNetDaysFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTermsNetDaysFilters.TermsNetDaysFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TermsNetDays
                                PurchaseOrderQueryRq.ORTermsNetDaysFilters.TermsNetDaysFilter.TermsNetDays.SetValue(6);
                        }
                        if (ORTermsNetDaysFiltersElementType2958 == "TermsNetDaysRangeFilter")
                        {
                                //Set field value for FromTermsNetDays
                                PurchaseOrderQueryRq.ORTermsNetDaysFilters.TermsNetDaysRangeFilter.FromTermsNetDays.SetValue(6);
                                //Set field value for ToTermsNetDays
                                PurchaseOrderQueryRq.ORTermsNetDaysFilters.TermsNetDaysRangeFilter.ToTermsNetDays.SetValue(6);
                        }
                        string ORTotalFiltersElementType2959 = "TotalFilter";
                        if (ORTotalFiltersElementType2959 == "TotalFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTotalFilters.TotalFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for Total
                                PurchaseOrderQueryRq.ORTotalFilters.TotalFilter.Total.SetValue(10.01);
                        }
                        if (ORTotalFiltersElementType2959 == "TotalRangeFilter")
                        {
                                //Set field value for FromTotal
                                PurchaseOrderQueryRq.ORTotalFilters.TotalRangeFilter.FromTotal.SetValue(10.01);
                                //Set field value for ToTotal
                                PurchaseOrderQueryRq.ORTotalFilters.TotalRangeFilter.ToTotal.SetValue(10.01);
                        }
                        string ORTxnDateFiltersElementType2960 = "TxnDateFilter";
                        if (ORTxnDateFiltersElementType2960 == "TxnDateFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORTxnDateFilters.TxnDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TxnDate
                                PurchaseOrderQueryRq.ORTxnDateFilters.TxnDateFilter.TxnDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        if (ORTxnDateFiltersElementType2960 == "TxnDateRangeFilter")
                        {
                                //Set field value for FromTxnDate
                                PurchaseOrderQueryRq.ORTxnDateFilters.TxnDateRangeFilter.FromTxnDate.SetValue(DateTime.Parse("12/15/2007"));
                                //Set field value for ToTxnDate
                                PurchaseOrderQueryRq.ORTxnDateFilters.TxnDateRangeFilter.ToTxnDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        string ORUnfilledPercentFiltersElementType2961 = "UnfilledPercentFilter";
                        if (ORUnfilledPercentFiltersElementType2961 == "UnfilledPercentFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                PurchaseOrderQueryRq.ORUnfilledPercentFilters.UnfilledPercentFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for UnfilledPercent
                                PurchaseOrderQueryRq.ORUnfilledPercentFilters.UnfilledPercentFilter.UnfilledPercent.SetValue(12.34F);
                        }
                        if (ORUnfilledPercentFiltersElementType2961 == "UnfilledPercentRangeFilter")
                        {
                                //Set field value for FromUnfilledPercent
                                PurchaseOrderQueryRq.ORUnfilledPercentFilters.UnfilledPercentRangeFilter.FromUnfilledPercent.SetValue(12.34F);
                                //Set field value for ToUnfilledPercent
                                PurchaseOrderQueryRq.ORUnfilledPercentFilters.UnfilledPercentRangeFilter.ToUnfilledPercent.SetValue(12.34F);
                        }
                        string ORVendorCodeFiltersElementType2962 = "VendorCodeFilter";
                        if (ORVendorCodeFiltersElementType2962 == "VendorCodeFilter")
                        {
                                //Set field value for MatchStringCriterion
                                PurchaseOrderQueryRq.ORVendorCodeFilters.VendorCodeFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for VendorCode
                                PurchaseOrderQueryRq.ORVendorCodeFilters.VendorCodeFilter.VendorCode.SetValue("ab");
                        }
                        if (ORVendorCodeFiltersElementType2962 == "VendorCodeRangeFilter")
                        {
                                //Set field value for FromVendorCode
                                PurchaseOrderQueryRq.ORVendorCodeFilters.VendorCodeRangeFilter.FromVendorCode.SetValue("ab");
                                //Set field value for ToVendorCode
                                PurchaseOrderQueryRq.ORVendorCodeFilters.VendorCodeRangeFilter.ToVendorCode.SetValue("ab");
                        }
                        //Set field value for VendorListID
                        PurchaseOrderQueryRq.VendorListID.SetValue("200000-1011023419");
                        //Set field value for IncludeRetElementList
                        //May create more than one of these if needed
                        PurchaseOrderQueryRq.IncludeRetElementList.Add("ab");
                }




                void WalkPurchaseOrderQueryRs(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.rtPurchaseOrderQueryRs)
                                                {
                                                        //upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        IPurchaseOrderRetList PurchaseOrderRet = (IPurchaseOrderRetList)response.Detail;
                                                        for(int z=0; z < PurchaseOrderRet.Count; z++)
                                                        {
                                                                WalkPurchaseOrderRet(PurchaseOrderRet.GetAt(z));
                                                        }
                                                }
                                        }
                                }
                        }
                }




                void WalkPurchaseOrderRet(IPurchaseOrderRet PurchaseOrderRet)
                {
                        if (PurchaseOrderRet == null) return;
                        //Go through all the elements of IPurchaseOrderRetList
                        //Get value of TxnID
                        if (PurchaseOrderRet.TxnID != null)
                        {
                                string TxnID2963 = (string)PurchaseOrderRet.TxnID.GetValue();
                        }
                        //Get value of TimeCreated
                        if (PurchaseOrderRet.TimeCreated != null)
                        {
                                DateTime TimeCreated2964 = (DateTime)PurchaseOrderRet.TimeCreated.GetValue();
                        }
                        //Get value of TimeModified
                        if (PurchaseOrderRet.TimeModified != null)
                        {
                                DateTime TimeModified2965 = (DateTime)PurchaseOrderRet.TimeModified.GetValue();
                        }
                        //Get value of Associate
                        if (PurchaseOrderRet.Associate != null)
                        {
                                string Associate2966 = (string)PurchaseOrderRet.Associate.GetValue();
                        }
                        //Get value of CancelDate
                        if (PurchaseOrderRet.CancelDate != null)
                        {
                                DateTime CancelDate2967 = (DateTime)PurchaseOrderRet.CancelDate.GetValue();
                        }
                        //Get value of CompanyName
                        if (PurchaseOrderRet.CompanyName != null)
                        {
                                string CompanyName2968 = (string)PurchaseOrderRet.CompanyName.GetValue();
                        }
                        //Get value of Discount
                        if (PurchaseOrderRet.Discount != null)
                        {
                                double Discount2969 = (double)PurchaseOrderRet.Discount.GetValue();
                        }
                        //Get value of DiscountPercent
                        if (PurchaseOrderRet.DiscountPercent != null)
                        {
                                float DiscountPercent2970 = (float)PurchaseOrderRet.DiscountPercent.GetValue();
                        }
                        //Get value of Fee
                        if (PurchaseOrderRet.Fee != null)
                        {
                                double Fee2971 = (double)PurchaseOrderRet.Fee.GetValue();
                        }
                        //Get value of Instructions
                        if (PurchaseOrderRet.Instructions != null)
                        {
                                string Instructions2972 = (string)PurchaseOrderRet.Instructions.GetValue();
                        }
                        //Get value of ItemsCount
                        if (PurchaseOrderRet.ItemsCount != null)
                        {
                                int ItemsCount2973 = (int)PurchaseOrderRet.ItemsCount.GetValue();
                        }
                        //Get value of PurchaseOrderNumber
                        if (PurchaseOrderRet.PurchaseOrderNumber != null)
                        {
                                string PurchaseOrderNumber2974 = (string)PurchaseOrderRet.PurchaseOrderNumber.GetValue();
                        }
                        //Get value of PurchaseOrderStatusDesc
                        if (PurchaseOrderRet.PurchaseOrderStatusDesc != null)
                        {
                                string PurchaseOrderStatusDesc2975 = (string)PurchaseOrderRet.PurchaseOrderStatusDesc.GetValue();
                        }
                        //Get value of QtyDue
                        if (PurchaseOrderRet.QtyDue != null)
                        {
                                int QtyDue2976 = (int)PurchaseOrderRet.QtyDue.GetValue();
                        }
                        //Get value of QtyOrdered
                        if (PurchaseOrderRet.QtyOrdered != null)
                        {
                                int QtyOrdered2977 = (int)PurchaseOrderRet.QtyOrdered.GetValue();
                        }
                        //Get value of QtyReceived
                        if (PurchaseOrderRet.QtyReceived != null)
                        {
                                int QtyReceived2978 = (int)PurchaseOrderRet.QtyReceived.GetValue();
                        }
                        //Get value of SalesOrderNumber
                        if (PurchaseOrderRet.SalesOrderNumber != null)
                        {
                                string SalesOrderNumber2979 = (string)PurchaseOrderRet.SalesOrderNumber.GetValue();
                        }
                        //Get value of ShipToStoreNumber
                        if (PurchaseOrderRet.ShipToStoreNumber != null)
                        {
                                int ShipToStoreNumber2980 = (int)PurchaseOrderRet.ShipToStoreNumber.GetValue();
                        }
                        //Get value of StartShipDate
                        if (PurchaseOrderRet.StartShipDate != null)
                        {
                                DateTime StartShipDate2981 = (DateTime)PurchaseOrderRet.StartShipDate.GetValue();
                        }
                        //Get value of StoreExchangeStatus
                        if (PurchaseOrderRet.StoreExchangeStatus != null)
                        {
                                ENStoreExchangeStatus StoreExchangeStatus2982 = (ENStoreExchangeStatus)PurchaseOrderRet.StoreExchangeStatus.GetValue();
                        }
                        //Get value of StoreNumber
                        if (PurchaseOrderRet.StoreNumber != null)
                        {
                                int StoreNumber2983 = (int)PurchaseOrderRet.StoreNumber.GetValue();
                        }
                        //Get value of Subtotal
                        if (PurchaseOrderRet.Subtotal != null)
                        {
                                double Subtotal2984 = (double)PurchaseOrderRet.Subtotal.GetValue();
                        }
                        //Get value of Terms
                        if (PurchaseOrderRet.Terms != null)
                        {
                                string Terms2985 = (string)PurchaseOrderRet.Terms.GetValue();
                        }
                        //Get value of TermsDiscount
                        if (PurchaseOrderRet.TermsDiscount != null)
                        {
                                float TermsDiscount2986 = (float)PurchaseOrderRet.TermsDiscount.GetValue();
                        }
                        //Get value of TermsDiscountDays
                        if (PurchaseOrderRet.TermsDiscountDays != null)
                        {
                                int TermsDiscountDays2987 = (int)PurchaseOrderRet.TermsDiscountDays.GetValue();
                        }
                        //Get value of TermsNetDays
                        if (PurchaseOrderRet.TermsNetDays != null)
                        {
                                int TermsNetDays2988 = (int)PurchaseOrderRet.TermsNetDays.GetValue();
                        }
                        //Get value of Total
                        if (PurchaseOrderRet.Total != null)
                        {
                                double Total2989 = (double)PurchaseOrderRet.Total.GetValue();
                        }
                        //Get value of TxnDate
                        if (PurchaseOrderRet.TxnDate != null)
                        {
                                DateTime TxnDate2990 = (DateTime)PurchaseOrderRet.TxnDate.GetValue();
                        }
                        //Get value of UnfilledPercent
                        if (PurchaseOrderRet.UnfilledPercent != null)
                        {
                                float UnfilledPercent2991 = (float)PurchaseOrderRet.UnfilledPercent.GetValue();
                        }
                        //Get value of VendorCode
                        if (PurchaseOrderRet.VendorCode != null)
                        {
                                string VendorCode2992 = (string)PurchaseOrderRet.VendorCode.GetValue();
                        }
                        //Get value of VendorListID
                        if (PurchaseOrderRet.VendorListID != null)
                        {
                                string VendorListID2993 = (string)PurchaseOrderRet.VendorListID.GetValue();
                        }
                        if (PurchaseOrderRet.PurchaseOrderItemRetList != null)
                        {
                                for (int i2994 = 0; i2994 < PurchaseOrderRet.PurchaseOrderItemRetList.Count; i2994++)
                                {
                                        IPurchaseOrderItemRet PurchaseOrderItemRet = PurchaseOrderRet.PurchaseOrderItemRetList.GetAt(i2994);
                                        //Get value of ListID
                                        if (PurchaseOrderItemRet.ListID != null)
                                        {
                                                string ListID2995 = (string)PurchaseOrderItemRet.ListID.GetValue();
                                        }
                                        //Get value of TxnLineID
                                        if (PurchaseOrderItemRet.TxnLineID != null)
                                        {
                                                int TxnLineID2996 = (int)PurchaseOrderItemRet.TxnLineID.GetValue();
                                        }
                                        //Get value of ALU
                                        if (PurchaseOrderItemRet.ALU != null)
                                        {
                                                string ALU2997 = (string)PurchaseOrderItemRet.ALU.GetValue();
                                        }
                                        //Get value of Attribute
                                        if (PurchaseOrderItemRet.Attribute != null)
                                        {
                                                string Attribute2998 = (string)PurchaseOrderItemRet.Attribute.GetValue();
                                        }
                                        //Get value of Cost
                                        if (PurchaseOrderItemRet.Cost != null)
                                        {
                                                double Cost2999 = (double)PurchaseOrderItemRet.Cost.GetValue();
                                        }
                                        //Get value of Desc1
                                        if (PurchaseOrderItemRet.Desc1 != null)
                                        {
                                                string Desc13000 = (string)PurchaseOrderItemRet.Desc1.GetValue();
                                        }
                                        //Get value of Desc2
                                        if (PurchaseOrderItemRet.Desc2 != null)
                                        {
                                                string Desc23001 = (string)PurchaseOrderItemRet.Desc2.GetValue();
                                        }
                                        //Get value of ExtendedCost
                                        if (PurchaseOrderItemRet.ExtendedCost != null)
                                        {
                                                double ExtendedCost3002 = (double)PurchaseOrderItemRet.ExtendedCost.GetValue();
                                        }
                                        //Get value of ItemNumber
                                        if (PurchaseOrderItemRet.ItemNumber != null)
                                        {
                                                int ItemNumber3003 = (int)PurchaseOrderItemRet.ItemNumber.GetValue();
                                        }
                                        //Get value of NumberOfBaseUnits
                                        if (PurchaseOrderItemRet.NumberOfBaseUnits != null)
                                        {
                                                int NumberOfBaseUnits3004 = (int)PurchaseOrderItemRet.NumberOfBaseUnits.GetValue();
                                        }
                                        //Get value of Qty
                                        if (PurchaseOrderItemRet.Qty != null)
                                        {
                                                int Qty3005 = (int)PurchaseOrderItemRet.Qty.GetValue();
                                        }
                                        //Get value of QtyReceived
                                        if (PurchaseOrderItemRet.QtyReceived != null)
                                        {
                                                int QtyReceived3006 = (int)PurchaseOrderItemRet.QtyReceived.GetValue();
                                        }
                                        //Get value of Size
                                        if (PurchaseOrderItemRet.Size != null)
                                        {
                                                string Size3007 = (string)PurchaseOrderItemRet.Size.GetValue();
                                        }
                                        //Get value of UnitOfMeasure
                                        if (PurchaseOrderItemRet.UnitOfMeasure != null)
                                        {
                                                string UnitOfMeasure3008 = (string)PurchaseOrderItemRet.UnitOfMeasure.GetValue();
                                        }
                                        //Get value of UPC
                                        if (PurchaseOrderItemRet.UPC != null)
                                        {
                                                string UPC3009 = (string)PurchaseOrderItemRet.UPC.GetValue();
                                        }
                                }
                        }
                        if (PurchaseOrderRet.DataExtRetList != null)
                        {
                                for (int i3010 = 0; i3010 < PurchaseOrderRet.DataExtRetList.Count; i3010++)
                                {
                                        IDataExtRet DataExtRet = PurchaseOrderRet.DataExtRetList.GetAt(i3010);
                                        //Get value of OwnerID
                                        string OwnerID3011 = (string)DataExtRet.OwnerID.GetValue();
                                        //Get value of DataExtName
                                        string DataExtName3012 = (string)DataExtRet.DataExtName.GetValue();
                                        //Get value of DataExtType
                                        ENDataExtType DataExtType3013 = (ENDataExtType)DataExtRet.DataExtType.GetValue();
                                        //Get value of DataExtValue
                                        string DataExtValue3014 = (string)DataExtRet.DataExtValue.GetValue();
                                }
                        }
                }




        }
}