PurchaseOrderMod

Modifies an existing PO in QBPOS. You must be careful when modifying line items in the purchase order! If you omit any existing txn lines in your mod, those lines will be dropped and you’ll lose their data. To retain a line, simply include its current TxnLineID: that’s all you need to do to retain the line. How do you add a new line to an existing PO? 1. In your PurchaseOrderMod, supply the TxnID of the purchase order you are mod’ing. except for the line items, which I’ll get to next, that’s ALL you need to supply. QBPOS will figure out all the other details using the TxnID you just gave. 2. Reconstruct the line items block. To do this, (a) Insert a separate PurchaseOrderItemMod aggregate for each existing line item that you want to keep, with that line’s current TxnLineID. That’s all you need to do for an existing line, unless you want to mod something within the line item, in which case you need to supply the elements you want to change. (b) If you want to delete any existing line item, simply omit its PurchaseOrderItemMod aggregate: that will cause the line to be dropped. (c) Wherever you want to add a new line in that existing PO, simply specify out its PurchaseOrderItemMod aggregate as you want, but use the TxnLineID value of -1 (minus 1). That tells QBPOS that its a new item.


Request

Response

XMLOPS

VB.NET

C#

Tag Type Max length Implementation Required

IPurchaseOrderMod

Modifies an existing PO in QBPOS. You must be careful when modifying line items in the purchase order! If you omit any existing txn lines in your mod, those lines will be dropped and you’ll lose their data. To retain a line, simply include its current TxnLineID: that’s all you need to do to retain the line. How do you add a new line to an existing PO? 1. In your PurchaseOrderMod, supply the TxnID of the purchase order you are mod’ing. except for the line items, which I’ll get to next, that’s ALL you need to supply. QBPOS will figure out all the other details using the TxnID you just gave. 2. Reconstruct the line items block. To do this, (a) Insert a separate PurchaseOrderItemMod aggregate for each existing line item that you want to keep, with that line’s current TxnLineID. That’s all you need to do for an existing line, unless you want to mod something within the line item, in which case you need to supply the elements you want to change. (b) If you want to delete any existing line item, simply omit its PurchaseOrderItemMod aggregate: that will cause the line to be dropped. (c) Wherever you want to add a new line in that existing PO, simply specify out its PurchaseOrderItemMod aggregate as you want, but use the TxnLineID value of -1 (minus 1). That tells QBPOS that its a new item.
       

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     Y

useMacro

You use a macro in a request message set if you need to create some object in one request, then refer to it in a subsequent request within that same message set. For example, you could create an inventory item and then include that item as a line item in a sales order all in one request message set, rather than create the item, query for it, then include it in a separate SalesOrderAdd request. In this latter case, you are accessing QBPOS three times, versus only once, using macros. The item to be referenced is specified via the defmacro. The actual reference to that item in the succeeding request is done via the use macro, as follows: ItemInventoryAdd defMacro=”ListID:Inv1” In the above line, you simply replace Inv1 with the name you want to give the macro. When you reference this macro in another request (one that requires that object’s listID) in the same message set, you use this syntax: ListID useMacro=”ListID:Inv1” This is covered in more detail in the Programming Guide.
IQBStringType   2.0  

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      

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    

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      

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      

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      

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  

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      

VendorListID

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

useMacro

You use a macro in a request message set if you need to create some object in one request, then refer to it in a subsequent request within that same message set. For example, you could create an inventory item and then include that item as a line item in a sales order all in one request message set, rather than create the item, query for it, then include it in a separate SalesOrderAdd request. In this latter case, you are accessing QBPOS three times, versus only once, using macros. The item to be referenced is specified via the defmacro. The actual reference to that item in the succeeding request is done via the use macro, as follows: ItemInventoryAdd defMacro=”ListID:Inv1” In the above line, you simply replace Inv1 with the name you want to give the macro. When you reference this macro in another request (one that requires that object’s listID) in the same message set, you use this syntax: ListID useMacro=”ListID:Inv1” This is covered in more detail in the Programming Guide.
IQBStringType   2.0  

PurchaseOrderItemModList

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

(List of IPurchaseOrderItemMod 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      

useMacro

You use a macro in a request message set if you need to create some object in one request, then refer to it in a subsequent request within that same message set. For example, you could create an inventory item and then include that item as a line item in a sales order all in one request message set, rather than create the item, query for it, then include it in a separate SalesOrderAdd request. In this latter case, you are accessing QBPOS three times, versus only once, using macros. The item to be referenced is specified via the defmacro. The actual reference to that item in the succeeding request is done via the use macro, as follows: ItemInventoryAdd defMacro=”ListID:Inv1” In the above line, you simply replace Inv1 with the name you want to give the macro. When you reference this macro in another request (one that requires that object’s listID) in the same message set, you use this syntax: ListID useMacro=”ListID:Inv1” This is covered in more detail in the Programming Guide.
IQBStringType   2.0  

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     Y

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      

Qty

The quantity of the line item being ordered or transferred.
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    

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

Modifies an existing PO in QBPOS. You must be careful when modifying line items in the purchase order! If you omit any existing txn lines in your mod, those lines will be dropped and you’ll lose their data. To retain a line, simply include its current TxnLineID: that’s all you need to do to retain the line. How do you add a new line to an existing PO? 1. In your PurchaseOrderMod, supply the TxnID of the purchase order you are mod’ing. except for the line items, which I’ll get to next, that’s ALL you need to supply. QBPOS will figure out all the other details using the TxnID you just gave. 2. Reconstruct the line items block. To do this, (a) Insert a separate PurchaseOrderItemMod aggregate for each existing line item that you want to keep, with that line’s current TxnLineID. That’s all you need to do for an existing line, unless you want to mod something within the line item, in which case you need to supply the elements you want to change. (b) If you want to delete any existing line item, simply omit its PurchaseOrderItemMod aggregate: that will cause the line to be dropped. (c) Wherever you want to add a new line in that existing PO, simply specify out its PurchaseOrderItemMod aggregate as you want, but use the TxnLineID value of -1 (minus 1). That tells QBPOS that its a new item.
       

StatusCode

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

StatusSeverity

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

StatusMessage

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

Detail

IPurchaseOrderRet      

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
<?xml version="1.0" encoding="utf-8"?>
<?qbposxml version="4.0"?>
<QBPOSXML>
        <QBPOSXMLMsgsRq onError="stopOnError">
                <PurchaseOrderModRq>
                        <PurchaseOrderMod> <!-- required -->
                                <TxnID  useMacro="MACROTYPE">IDTYPE</TxnID> <!-- required -->
                                <Associate >STRTYPE</Associate> <!-- optional -->
                                <CancelDate >DATETYPE</CancelDate> <!-- optional -->
                                <Discount >AMTTYPE</Discount> <!-- optional -->
                                <DiscountPercent >FLOATTYPE</DiscountPercent> <!-- optional -->
                                <Fee >AMTTYPE</Fee> <!-- optional -->
                                <Instructions >STRTYPE</Instructions> <!-- optional -->
                                <PurchaseOrderNumber >STRTYPE</PurchaseOrderNumber> <!-- optional -->
                                <PurchaseOrderStatusDesc >STRTYPE</PurchaseOrderStatusDesc> <!-- optional -->
                                <ShipToStoreNumber >INTTYPE</ShipToStoreNumber> <!-- optional -->
                                <StartShipDate >DATETYPE</StartShipDate> <!-- optional -->
                                <StoreNumber >INTTYPE</StoreNumber> <!-- optional -->
                                <TermsDiscount >FLOATTYPE</TermsDiscount> <!-- optional -->
                                <TermsDiscountDays >INTTYPE</TermsDiscountDays> <!-- optional -->
                                <TermsNetDays >INTTYPE</TermsNetDays> <!-- optional -->
                                <TxnDate >DATETYPE</TxnDate> <!-- optional -->
                                <VendorListID  useMacro="MACROTYPE">IDTYPE</VendorListID> <!-- optional -->
                                <PurchaseOrderItemMod> <!-- optional, may repeat -->
                                        <ListID  useMacro="MACROTYPE">IDTYPE</ListID> <!-- optional -->
                                        <TxnLineID >INTTYPE</TxnLineID> <!-- required -->
                                        <ALU >STRTYPE</ALU> <!-- optional -->
                                        <Attribute >STRTYPE</Attribute> <!-- optional -->
                                        <Cost >AMTTYPE</Cost> <!-- optional -->
                                        <Desc1 >STRTYPE</Desc1> <!-- optional -->
                                        <Desc2 >STRTYPE</Desc2> <!-- optional -->
                                        <ExtendedCost >AMTTYPE</ExtendedCost> <!-- optional -->
                                        <Qty >QUANTYPE</Qty> <!-- optional -->
                                        <Size >STRTYPE</Size> <!-- optional -->
                                        <UnitOfMeasure >STRTYPE</UnitOfMeasure> <!-- optional -->
                                        <UPC >STRTYPE</UPC> <!-- optional -->
                                </PurchaseOrderItemMod>
                        </PurchaseOrderMod>
                        <IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat -->
                </PurchaseOrderModRq>

                <PurchaseOrderModRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE">
                        <PurchaseOrderRet> <!-- optional -->
                                <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>
                </PurchaseOrderModRs>
        </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
'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 SamplePurchaseOrderMod
                Public Sub  DoPurchaseOrderMod()
                        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

                                BuildPurchaseOrderModRq(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

                                WalkPurchaseOrderModRs(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 BuildPurchaseOrderModRq(requestMsgSet as IMsgSetRequest)
                        Dim PurchaseOrderModRq as IPurchaseOrderMod
                        PurchaseOrderModRq= requestMsgSet.AppendPurchaseOrderModRq()
                        'Set field value for TxnID
                        PurchaseOrderModRq.TxnID.SetValue("200000-1011023419")
                        'Set attributes
                        'Set field value for TxnID to use Macro
                        PurchaseOrderModRq.TxnID.SetValueUseMacro("200000-1011023419")
                        'Set field value for Associate
                        PurchaseOrderModRq.Associate.SetValue("ab")
                        'Set field value for CancelDate
                        PurchaseOrderModRq.CancelDate.SetValue(DateTime.Parse("12/15/2007"))
                        'Set field value for Discount
                        PurchaseOrderModRq.Discount.SetValue(10.01)
                        'Set field value for DiscountPercent
                        PurchaseOrderModRq.DiscountPercent.SetValue(12.34)
                        'Set field value for Fee
                        PurchaseOrderModRq.Fee.SetValue(10.01)
                        'Set field value for Instructions
                        PurchaseOrderModRq.Instructions.SetValue("ab")
                        'Set field value for PurchaseOrderNumber
                        PurchaseOrderModRq.PurchaseOrderNumber.SetValue("ab")
                        'Set field value for PurchaseOrderStatusDesc
                        PurchaseOrderModRq.PurchaseOrderStatusDesc.SetValue("ab")
                        'Set field value for ShipToStoreNumber
                        PurchaseOrderModRq.ShipToStoreNumber.SetValue(6)
                        'Set field value for StartShipDate
                        PurchaseOrderModRq.StartShipDate.SetValue(DateTime.Parse("12/15/2007"))
                        'Set field value for StoreNumber
                        PurchaseOrderModRq.StoreNumber.SetValue(6)
                        'Set field value for TermsDiscount
                        PurchaseOrderModRq.TermsDiscount.SetValue(12.34)
                        'Set field value for TermsDiscountDays
                        PurchaseOrderModRq.TermsDiscountDays.SetValue(6)
                        'Set field value for TermsNetDays
                        PurchaseOrderModRq.TermsNetDays.SetValue(6)
                        'Set field value for TxnDate
                        PurchaseOrderModRq.TxnDate.SetValue(DateTime.Parse("12/15/2007"))
                        'Set field value for VendorListID
                        PurchaseOrderModRq.VendorListID.SetValue("200000-1011023419")
                        'Set attributes
                        'Set field value for VendorListID to use Macro
                        PurchaseOrderModRq.VendorListID.SetValueUseMacro("200000-1011023419")
                        Dim PurchaseOrderItemMod2755 as IPurchaseOrderItemMod
                        PurchaseOrderItemMod2755=PurchaseOrderModRq.PurchaseOrderItemModList.Append()
                        'Set field value for ListID
                        PurchaseOrderItemMod2755.ListID.SetValue("200000-1011023419")
                        'Set attributes
                        'Set field value for ListID to use Macro
                        PurchaseOrderItemMod2755.ListID.SetValueUseMacro("200000-1011023419")
                        'Set field value for TxnLineID
                        PurchaseOrderItemMod2755.TxnLineID.SetValue(6)
                        'Set field value for ALU
                        PurchaseOrderItemMod2755.ALU.SetValue("ab")
                        'Set field value for Attribute
                        PurchaseOrderItemMod2755.Attribute.SetValue("ab")
                        'Set field value for Cost
                        PurchaseOrderItemMod2755.Cost.SetValue(10.01)
                        'Set field value for Desc1
                        PurchaseOrderItemMod2755.Desc1.SetValue("ab")
                        'Set field value for Desc2
                        PurchaseOrderItemMod2755.Desc2.SetValue("ab")
                        'Set field value for ExtendedCost
                        PurchaseOrderItemMod2755.ExtendedCost.SetValue(10.01)
                        'Set field value for Qty
                        PurchaseOrderItemMod2755.Qty.SetValue(2)
                        'Set field value for Size
                        PurchaseOrderItemMod2755.Size.SetValue("ab")
                        'Set field value for UnitOfMeasure
                        PurchaseOrderItemMod2755.UnitOfMeasure.SetValue("ab")
                        'Set field value for UPC
                        PurchaseOrderItemMod2755.UPC.SetValue("ab")
                        'Set field value for IncludeRetElementList
                        'May create more than one of these if needed
                        PurchaseOrderModRq.IncludeRetElementList.Add("ab")
                End Sub




                Public Sub WalkPurchaseOrderModRs( 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.rtPurchaseOrderModRs) then
                                                        'upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        Dim PurchaseOrderRet as IPurchaseOrderRet
                                                        PurchaseOrderRet = CType(response.Detail,IPurchaseOrderRet)
                                                                WalkPurchaseOrderRet(PurchaseOrderRet)
                                                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 IPurchaseOrderRet
                        'Get value of TxnID
                        if ( not PurchaseOrderRet.TxnID is nothing) then
                                Dim TxnID2756 as String
                                TxnID2756 = PurchaseOrderRet.TxnID.GetValue()
                        End If
                        'Get value of TimeCreated
                        if ( not PurchaseOrderRet.TimeCreated is nothing) then
                                Dim TimeCreated2757 as DateTime
                                TimeCreated2757 = PurchaseOrderRet.TimeCreated.GetValue()
                        End If
                        'Get value of TimeModified
                        if ( not PurchaseOrderRet.TimeModified is nothing) then
                                Dim TimeModified2758 as DateTime
                                TimeModified2758 = PurchaseOrderRet.TimeModified.GetValue()
                        End If
                        'Get value of Associate
                        if ( not PurchaseOrderRet.Associate is nothing) then
                                Dim Associate2759 as String
                                Associate2759 = PurchaseOrderRet.Associate.GetValue()
                        End If
                        'Get value of CancelDate
                        if ( not PurchaseOrderRet.CancelDate is nothing) then
                                Dim CancelDate2760 as DateTime
                                CancelDate2760 = PurchaseOrderRet.CancelDate.GetValue()
                        End If
                        'Get value of CompanyName
                        if ( not PurchaseOrderRet.CompanyName is nothing) then
                                Dim CompanyName2761 as String
                                CompanyName2761 = PurchaseOrderRet.CompanyName.GetValue()
                        End If
                        'Get value of Discount
                        if ( not PurchaseOrderRet.Discount is nothing) then
                                Dim Discount2762 as Double
                                Discount2762 = PurchaseOrderRet.Discount.GetValue()
                        End If
                        'Get value of DiscountPercent
                        if ( not PurchaseOrderRet.DiscountPercent is nothing) then
                                Dim DiscountPercent2763 as Single
                                DiscountPercent2763 = PurchaseOrderRet.DiscountPercent.GetValue()
                        End If
                        'Get value of Fee
                        if ( not PurchaseOrderRet.Fee is nothing) then
                                Dim Fee2764 as Double
                                Fee2764 = PurchaseOrderRet.Fee.GetValue()
                        End If
                        'Get value of Instructions
                        if ( not PurchaseOrderRet.Instructions is nothing) then
                                Dim Instructions2765 as String
                                Instructions2765 = PurchaseOrderRet.Instructions.GetValue()
                        End If
                        'Get value of ItemsCount
                        if ( not PurchaseOrderRet.ItemsCount is nothing) then
                                Dim ItemsCount2766 as Integer
                                ItemsCount2766 = PurchaseOrderRet.ItemsCount.GetValue()
                        End If
                        'Get value of PurchaseOrderNumber
                        if ( not PurchaseOrderRet.PurchaseOrderNumber is nothing) then
                                Dim PurchaseOrderNumber2767 as String
                                PurchaseOrderNumber2767 = PurchaseOrderRet.PurchaseOrderNumber.GetValue()
                        End If
                        'Get value of PurchaseOrderStatusDesc
                        if ( not PurchaseOrderRet.PurchaseOrderStatusDesc is nothing) then
                                Dim PurchaseOrderStatusDesc2768 as String
                                PurchaseOrderStatusDesc2768 = PurchaseOrderRet.PurchaseOrderStatusDesc.GetValue()
                        End If
                        'Get value of QtyDue
                        if ( not PurchaseOrderRet.QtyDue is nothing) then
                                Dim QtyDue2769 as Double
                                QtyDue2769 = PurchaseOrderRet.QtyDue.GetValue()
                        End If
                        'Get value of QtyOrdered
                        if ( not PurchaseOrderRet.QtyOrdered is nothing) then
                                Dim QtyOrdered2770 as Double
                                QtyOrdered2770 = PurchaseOrderRet.QtyOrdered.GetValue()
                        End If
                        'Get value of QtyReceived
                        if ( not PurchaseOrderRet.QtyReceived is nothing) then
                                Dim QtyReceived2771 as Double
                                QtyReceived2771 = PurchaseOrderRet.QtyReceived.GetValue()
                        End If
                        'Get value of SalesOrderNumber
                        if ( not PurchaseOrderRet.SalesOrderNumber is nothing) then
                                Dim SalesOrderNumber2772 as String
                                SalesOrderNumber2772 = PurchaseOrderRet.SalesOrderNumber.GetValue()
                        End If
                        'Get value of ShipToStoreNumber
                        if ( not PurchaseOrderRet.ShipToStoreNumber is nothing) then
                                Dim ShipToStoreNumber2773 as Integer
                                ShipToStoreNumber2773 = PurchaseOrderRet.ShipToStoreNumber.GetValue()
                        End If
                        'Get value of StartShipDate
                        if ( not PurchaseOrderRet.StartShipDate is nothing) then
                                Dim StartShipDate2774 as DateTime
                                StartShipDate2774 = PurchaseOrderRet.StartShipDate.GetValue()
                        End If
                        'Get value of StoreExchangeStatus
                        if ( not PurchaseOrderRet.StoreExchangeStatus is nothing) then
                                Dim StoreExchangeStatus2775 as ENStoreExchangeStatus
                                StoreExchangeStatus2775 = PurchaseOrderRet.StoreExchangeStatus.GetValue()
                        End If
                        'Get value of StoreNumber
                        if ( not PurchaseOrderRet.StoreNumber is nothing) then
                                Dim StoreNumber2776 as Integer
                                StoreNumber2776 = PurchaseOrderRet.StoreNumber.GetValue()
                        End If
                        'Get value of Subtotal
                        if ( not PurchaseOrderRet.Subtotal is nothing) then
                                Dim Subtotal2777 as Double
                                Subtotal2777 = PurchaseOrderRet.Subtotal.GetValue()
                        End If
                        'Get value of Terms
                        if ( not PurchaseOrderRet.Terms is nothing) then
                                Dim Terms2778 as String
                                Terms2778 = PurchaseOrderRet.Terms.GetValue()
                        End If
                        'Get value of TermsDiscount
                        if ( not PurchaseOrderRet.TermsDiscount is nothing) then
                                Dim TermsDiscount2779 as Single
                                TermsDiscount2779 = PurchaseOrderRet.TermsDiscount.GetValue()
                        End If
                        'Get value of TermsDiscountDays
                        if ( not PurchaseOrderRet.TermsDiscountDays is nothing) then
                                Dim TermsDiscountDays2780 as Integer
                                TermsDiscountDays2780 = PurchaseOrderRet.TermsDiscountDays.GetValue()
                        End If
                        'Get value of TermsNetDays
                        if ( not PurchaseOrderRet.TermsNetDays is nothing) then
                                Dim TermsNetDays2781 as Integer
                                TermsNetDays2781 = PurchaseOrderRet.TermsNetDays.GetValue()
                        End If
                        'Get value of Total
                        if ( not PurchaseOrderRet.Total is nothing) then
                                Dim Total2782 as Double
                                Total2782 = PurchaseOrderRet.Total.GetValue()
                        End If
                        'Get value of TxnDate
                        if ( not PurchaseOrderRet.TxnDate is nothing) then
                                Dim TxnDate2783 as DateTime
                                TxnDate2783 = PurchaseOrderRet.TxnDate.GetValue()
                        End If
                        'Get value of UnfilledPercent
                        if ( not PurchaseOrderRet.UnfilledPercent is nothing) then
                                Dim UnfilledPercent2784 as Single
                                UnfilledPercent2784 = PurchaseOrderRet.UnfilledPercent.GetValue()
                        End If
                        'Get value of VendorCode
                        if ( not PurchaseOrderRet.VendorCode is nothing) then
                                Dim VendorCode2785 as String
                                VendorCode2785 = PurchaseOrderRet.VendorCode.GetValue()
                        End If
                        'Get value of VendorListID
                        if ( not PurchaseOrderRet.VendorListID is nothing) then
                                Dim VendorListID2786 as String
                                VendorListID2786 = PurchaseOrderRet.VendorListID.GetValue()
                        End If
                        if (not PurchaseOrderRet.PurchaseOrderItemRetList is nothing)
                                Dim i2787 as Integer
                                for i2787 = 0  to PurchaseOrderRet.PurchaseOrderItemRetList.Count - 1
                                        Dim PurchaseOrderItemRet as IPurchaseOrderItemRet
                                        PurchaseOrderItemRet = PurchaseOrderRet.PurchaseOrderItemRetList.GetAt(i2787)
                                        'Get value of ListID
                                        if ( not PurchaseOrderItemRet.ListID is nothing) then
                                                Dim ListID2788 as String
                                                ListID2788 = PurchaseOrderItemRet.ListID.GetValue()
                                        End If
                                        'Get value of TxnLineID
                                        if ( not PurchaseOrderItemRet.TxnLineID is nothing) then
                                                Dim TxnLineID2789 as Integer
                                                TxnLineID2789 = PurchaseOrderItemRet.TxnLineID.GetValue()
                                        End If
                                        'Get value of ALU
                                        if ( not PurchaseOrderItemRet.ALU is nothing) then
                                                Dim ALU2790 as String
                                                ALU2790 = PurchaseOrderItemRet.ALU.GetValue()
                                        End If
                                        'Get value of Attribute
                                        if ( not PurchaseOrderItemRet.Attribute is nothing) then
                                                Dim Attribute2791 as String
                                                Attribute2791 = PurchaseOrderItemRet.Attribute.GetValue()
                                        End If
                                        'Get value of Cost
                                        if ( not PurchaseOrderItemRet.Cost is nothing) then
                                                Dim Cost2792 as Double
                                                Cost2792 = PurchaseOrderItemRet.Cost.GetValue()
                                        End If
                                        'Get value of Desc1
                                        if ( not PurchaseOrderItemRet.Desc1 is nothing) then
                                                Dim Desc12793 as String
                                                Desc12793 = PurchaseOrderItemRet.Desc1.GetValue()
                                        End If
                                        'Get value of Desc2
                                        if ( not PurchaseOrderItemRet.Desc2 is nothing) then
                                                Dim Desc22794 as String
                                                Desc22794 = PurchaseOrderItemRet.Desc2.GetValue()
                                        End If
                                        'Get value of ExtendedCost
                                        if ( not PurchaseOrderItemRet.ExtendedCost is nothing) then
                                                Dim ExtendedCost2795 as Double
                                                ExtendedCost2795 = PurchaseOrderItemRet.ExtendedCost.GetValue()
                                        End If
                                        'Get value of ItemNumber
                                        if ( not PurchaseOrderItemRet.ItemNumber is nothing) then
                                                Dim ItemNumber2796 as Integer
                                                ItemNumber2796 = PurchaseOrderItemRet.ItemNumber.GetValue()
                                        End If
                                        'Get value of NumberOfBaseUnits
                                        if ( not PurchaseOrderItemRet.NumberOfBaseUnits is nothing) then
                                                Dim NumberOfBaseUnits2797 as Double
                                                NumberOfBaseUnits2797 = PurchaseOrderItemRet.NumberOfBaseUnits.GetValue()
                                        End If
                                        'Get value of Qty
                                        if ( not PurchaseOrderItemRet.Qty is nothing) then
                                                Dim Qty2798 as Double
                                                Qty2798 = PurchaseOrderItemRet.Qty.GetValue()
                                        End If
                                        'Get value of QtyReceived
                                        if ( not PurchaseOrderItemRet.QtyReceived is nothing) then
                                                Dim QtyReceived2799 as Double
                                                QtyReceived2799 = PurchaseOrderItemRet.QtyReceived.GetValue()
                                        End If
                                        'Get value of Size
                                        if ( not PurchaseOrderItemRet.Size is nothing) then
                                                Dim Size2800 as String
                                                Size2800 = PurchaseOrderItemRet.Size.GetValue()
                                        End If
                                        'Get value of UnitOfMeasure
                                        if ( not PurchaseOrderItemRet.UnitOfMeasure is nothing) then
                                                Dim UnitOfMeasure2801 as String
                                                UnitOfMeasure2801 = PurchaseOrderItemRet.UnitOfMeasure.GetValue()
                                        End If
                                        'Get value of UPC
                                        if ( not PurchaseOrderItemRet.UPC is nothing) then
                                                Dim UPC2802 as String
                                                UPC2802 = PurchaseOrderItemRet.UPC.GetValue()
                                        End If
                                Next i2787
                        End If
                        if (not PurchaseOrderRet.DataExtRetList is nothing)
                                Dim i2803 as Integer
                                for i2803 = 0  to PurchaseOrderRet.DataExtRetList.Count - 1
                                        Dim DataExtRet as IDataExtRet
                                        DataExtRet = PurchaseOrderRet.DataExtRetList.GetAt(i2803)
                                        'Get value of OwnerID
                                        Dim OwnerID2804 as String
                                        OwnerID2804 = DataExtRet.OwnerID.GetValue()
                                        'Get value of DataExtName
                                        Dim DataExtName2805 as String
                                        DataExtName2805 = DataExtRet.DataExtName.GetValue()
                                        'Get value of DataExtType
                                        Dim DataExtType2806 as ENDataExtType
                                        DataExtType2806 = DataExtRet.DataExtType.GetValue()
                                        'Get value of DataExtValue
                                        Dim DataExtValue2807 as String
                                        DataExtValue2807 = DataExtRet.DataExtValue.GetValue()
                                Next i2803
                        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
//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 SamplePurchaseOrderMod
        {
                public void  DoPurchaseOrderMod()
                {
                        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;

                                BuildPurchaseOrderModRq(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;

                                WalkPurchaseOrderModRs(responseMsgSet);
                        }
                        catch (Exception e)
                        {
                                MessageBox.Show(e.Message, "Error");
                                if (sessionBegun)
                                {
                                        sessionManager.EndSession();
                                }
                                if (connectionOpen)
                                {
                                        sessionManager.CloseConnection();
                                }
                        }
                }
                void BuildPurchaseOrderModRq(IMsgSetRequest requestMsgSet)
                {
                        IPurchaseOrderMod PurchaseOrderModRq= requestMsgSet.AppendPurchaseOrderModRq();
                        //Set field value for TxnID
                        PurchaseOrderModRq.TxnID.SetValue("200000-1011023419");
                        //Set attributes
                        //Set field value for TxnID to use Macro
                        PurchaseOrderModRq.TxnID.SetValueUseMacro("200000-1011023419");
                        //Set field value for Associate
                        PurchaseOrderModRq.Associate.SetValue("ab");
                        //Set field value for CancelDate
                        PurchaseOrderModRq.CancelDate.SetValue(DateTime.Parse("12/15/2007"));
                        //Set field value for Discount
                        PurchaseOrderModRq.Discount.SetValue(10.01);
                        //Set field value for DiscountPercent
                        PurchaseOrderModRq.DiscountPercent.SetValue(12.34F);
                        //Set field value for Fee
                        PurchaseOrderModRq.Fee.SetValue(10.01);
                        //Set field value for Instructions
                        PurchaseOrderModRq.Instructions.SetValue("ab");
                        //Set field value for PurchaseOrderNumber
                        PurchaseOrderModRq.PurchaseOrderNumber.SetValue("ab");
                        //Set field value for PurchaseOrderStatusDesc
                        PurchaseOrderModRq.PurchaseOrderStatusDesc.SetValue("ab");
                        //Set field value for ShipToStoreNumber
                        PurchaseOrderModRq.ShipToStoreNumber.SetValue(6);
                        //Set field value for StartShipDate
                        PurchaseOrderModRq.StartShipDate.SetValue(DateTime.Parse("12/15/2007"));
                        //Set field value for StoreNumber
                        PurchaseOrderModRq.StoreNumber.SetValue(6);
                        //Set field value for TermsDiscount
                        PurchaseOrderModRq.TermsDiscount.SetValue(12.34F);
                        //Set field value for TermsDiscountDays
                        PurchaseOrderModRq.TermsDiscountDays.SetValue(6);
                        //Set field value for TermsNetDays
                        PurchaseOrderModRq.TermsNetDays.SetValue(6);
                        //Set field value for TxnDate
                        PurchaseOrderModRq.TxnDate.SetValue(DateTime.Parse("12/15/2007"));
                        //Set field value for VendorListID
                        PurchaseOrderModRq.VendorListID.SetValue("200000-1011023419");
                        //Set attributes
                        //Set field value for VendorListID to use Macro
                        PurchaseOrderModRq.VendorListID.SetValueUseMacro("200000-1011023419");
                        IPurchaseOrderItemMod PurchaseOrderItemMod2808=PurchaseOrderModRq.PurchaseOrderItemModList.Append();
                        //Set field value for ListID
                        PurchaseOrderItemMod2808.ListID.SetValue("200000-1011023419");
                        //Set attributes
                        //Set field value for ListID to use Macro
                        PurchaseOrderItemMod2808.ListID.SetValueUseMacro("200000-1011023419");
                        //Set field value for TxnLineID
                        PurchaseOrderItemMod2808.TxnLineID.SetValue(6);
                        //Set field value for ALU
                        PurchaseOrderItemMod2808.ALU.SetValue("ab");
                        //Set field value for Attribute
                        PurchaseOrderItemMod2808.Attribute.SetValue("ab");
                        //Set field value for Cost
                        PurchaseOrderItemMod2808.Cost.SetValue(10.01);
                        //Set field value for Desc1
                        PurchaseOrderItemMod2808.Desc1.SetValue("ab");
                        //Set field value for Desc2
                        PurchaseOrderItemMod2808.Desc2.SetValue("ab");
                        //Set field value for ExtendedCost
                        PurchaseOrderItemMod2808.ExtendedCost.SetValue(10.01);
                        //Set field value for Qty
                        PurchaseOrderItemMod2808.Qty.SetValue(2);
                        //Set field value for Size
                        PurchaseOrderItemMod2808.Size.SetValue("ab");
                        //Set field value for UnitOfMeasure
                        PurchaseOrderItemMod2808.UnitOfMeasure.SetValue("ab");
                        //Set field value for UPC
                        PurchaseOrderItemMod2808.UPC.SetValue("ab");
                        //Set field value for IncludeRetElementList
                        //May create more than one of these if needed
                        PurchaseOrderModRq.IncludeRetElementList.Add("ab");
                }




                void WalkPurchaseOrderModRs(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.rtPurchaseOrderModRs)
                                                {
                                                        //upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        IPurchaseOrderRet PurchaseOrderRet = (IPurchaseOrderRet)response.Detail;
                                                                WalkPurchaseOrderRet(PurchaseOrderRet);
                                                }
                                        }
                                }
                        }
                }




                void WalkPurchaseOrderRet(IPurchaseOrderRet PurchaseOrderRet)
                {
                        if (PurchaseOrderRet == null) return;
                        //Go through all the elements of IPurchaseOrderRet
                        //Get value of TxnID
                        if (PurchaseOrderRet.TxnID != null)
                        {
                                string TxnID2809 = (string)PurchaseOrderRet.TxnID.GetValue();
                        }
                        //Get value of TimeCreated
                        if (PurchaseOrderRet.TimeCreated != null)
                        {
                                DateTime TimeCreated2810 = (DateTime)PurchaseOrderRet.TimeCreated.GetValue();
                        }
                        //Get value of TimeModified
                        if (PurchaseOrderRet.TimeModified != null)
                        {
                                DateTime TimeModified2811 = (DateTime)PurchaseOrderRet.TimeModified.GetValue();
                        }
                        //Get value of Associate
                        if (PurchaseOrderRet.Associate != null)
                        {
                                string Associate2812 = (string)PurchaseOrderRet.Associate.GetValue();
                        }
                        //Get value of CancelDate
                        if (PurchaseOrderRet.CancelDate != null)
                        {
                                DateTime CancelDate2813 = (DateTime)PurchaseOrderRet.CancelDate.GetValue();
                        }
                        //Get value of CompanyName
                        if (PurchaseOrderRet.CompanyName != null)
                        {
                                string CompanyName2814 = (string)PurchaseOrderRet.CompanyName.GetValue();
                        }
                        //Get value of Discount
                        if (PurchaseOrderRet.Discount != null)
                        {
                                double Discount2815 = (double)PurchaseOrderRet.Discount.GetValue();
                        }
                        //Get value of DiscountPercent
                        if (PurchaseOrderRet.DiscountPercent != null)
                        {
                                float DiscountPercent2816 = (float)PurchaseOrderRet.DiscountPercent.GetValue();
                        }
                        //Get value of Fee
                        if (PurchaseOrderRet.Fee != null)
                        {
                                double Fee2817 = (double)PurchaseOrderRet.Fee.GetValue();
                        }
                        //Get value of Instructions
                        if (PurchaseOrderRet.Instructions != null)
                        {
                                string Instructions2818 = (string)PurchaseOrderRet.Instructions.GetValue();
                        }
                        //Get value of ItemsCount
                        if (PurchaseOrderRet.ItemsCount != null)
                        {
                                int ItemsCount2819 = (int)PurchaseOrderRet.ItemsCount.GetValue();
                        }
                        //Get value of PurchaseOrderNumber
                        if (PurchaseOrderRet.PurchaseOrderNumber != null)
                        {
                                string PurchaseOrderNumber2820 = (string)PurchaseOrderRet.PurchaseOrderNumber.GetValue();
                        }
                        //Get value of PurchaseOrderStatusDesc
                        if (PurchaseOrderRet.PurchaseOrderStatusDesc != null)
                        {
                                string PurchaseOrderStatusDesc2821 = (string)PurchaseOrderRet.PurchaseOrderStatusDesc.GetValue();
                        }
                        //Get value of QtyDue
                        if (PurchaseOrderRet.QtyDue != null)
                        {
                                int QtyDue2822 = (int)PurchaseOrderRet.QtyDue.GetValue();
                        }
                        //Get value of QtyOrdered
                        if (PurchaseOrderRet.QtyOrdered != null)
                        {
                                int QtyOrdered2823 = (int)PurchaseOrderRet.QtyOrdered.GetValue();
                        }
                        //Get value of QtyReceived
                        if (PurchaseOrderRet.QtyReceived != null)
                        {
                                int QtyReceived2824 = (int)PurchaseOrderRet.QtyReceived.GetValue();
                        }
                        //Get value of SalesOrderNumber
                        if (PurchaseOrderRet.SalesOrderNumber != null)
                        {
                                string SalesOrderNumber2825 = (string)PurchaseOrderRet.SalesOrderNumber.GetValue();
                        }
                        //Get value of ShipToStoreNumber
                        if (PurchaseOrderRet.ShipToStoreNumber != null)
                        {
                                int ShipToStoreNumber2826 = (int)PurchaseOrderRet.ShipToStoreNumber.GetValue();
                        }
                        //Get value of StartShipDate
                        if (PurchaseOrderRet.StartShipDate != null)
                        {
                                DateTime StartShipDate2827 = (DateTime)PurchaseOrderRet.StartShipDate.GetValue();
                        }
                        //Get value of StoreExchangeStatus
                        if (PurchaseOrderRet.StoreExchangeStatus != null)
                        {
                                ENStoreExchangeStatus StoreExchangeStatus2828 = (ENStoreExchangeStatus)PurchaseOrderRet.StoreExchangeStatus.GetValue();
                        }
                        //Get value of StoreNumber
                        if (PurchaseOrderRet.StoreNumber != null)
                        {
                                int StoreNumber2829 = (int)PurchaseOrderRet.StoreNumber.GetValue();
                        }
                        //Get value of Subtotal
                        if (PurchaseOrderRet.Subtotal != null)
                        {
                                double Subtotal2830 = (double)PurchaseOrderRet.Subtotal.GetValue();
                        }
                        //Get value of Terms
                        if (PurchaseOrderRet.Terms != null)
                        {
                                string Terms2831 = (string)PurchaseOrderRet.Terms.GetValue();
                        }
                        //Get value of TermsDiscount
                        if (PurchaseOrderRet.TermsDiscount != null)
                        {
                                float TermsDiscount2832 = (float)PurchaseOrderRet.TermsDiscount.GetValue();
                        }
                        //Get value of TermsDiscountDays
                        if (PurchaseOrderRet.TermsDiscountDays != null)
                        {
                                int TermsDiscountDays2833 = (int)PurchaseOrderRet.TermsDiscountDays.GetValue();
                        }
                        //Get value of TermsNetDays
                        if (PurchaseOrderRet.TermsNetDays != null)
                        {
                                int TermsNetDays2834 = (int)PurchaseOrderRet.TermsNetDays.GetValue();
                        }
                        //Get value of Total
                        if (PurchaseOrderRet.Total != null)
                        {
                                double Total2835 = (double)PurchaseOrderRet.Total.GetValue();
                        }
                        //Get value of TxnDate
                        if (PurchaseOrderRet.TxnDate != null)
                        {
                                DateTime TxnDate2836 = (DateTime)PurchaseOrderRet.TxnDate.GetValue();
                        }
                        //Get value of UnfilledPercent
                        if (PurchaseOrderRet.UnfilledPercent != null)
                        {
                                float UnfilledPercent2837 = (float)PurchaseOrderRet.UnfilledPercent.GetValue();
                        }
                        //Get value of VendorCode
                        if (PurchaseOrderRet.VendorCode != null)
                        {
                                string VendorCode2838 = (string)PurchaseOrderRet.VendorCode.GetValue();
                        }
                        //Get value of VendorListID
                        if (PurchaseOrderRet.VendorListID != null)
                        {
                                string VendorListID2839 = (string)PurchaseOrderRet.VendorListID.GetValue();
                        }
                        if (PurchaseOrderRet.PurchaseOrderItemRetList != null)
                        {
                                for (int i2840 = 0; i2840 < PurchaseOrderRet.PurchaseOrderItemRetList.Count; i2840++)
                                {
                                        IPurchaseOrderItemRet PurchaseOrderItemRet = PurchaseOrderRet.PurchaseOrderItemRetList.GetAt(i2840);
                                        //Get value of ListID
                                        if (PurchaseOrderItemRet.ListID != null)
                                        {
                                                string ListID2841 = (string)PurchaseOrderItemRet.ListID.GetValue();
                                        }
                                        //Get value of TxnLineID
                                        if (PurchaseOrderItemRet.TxnLineID != null)
                                        {
                                                int TxnLineID2842 = (int)PurchaseOrderItemRet.TxnLineID.GetValue();
                                        }
                                        //Get value of ALU
                                        if (PurchaseOrderItemRet.ALU != null)
                                        {
                                                string ALU2843 = (string)PurchaseOrderItemRet.ALU.GetValue();
                                        }
                                        //Get value of Attribute
                                        if (PurchaseOrderItemRet.Attribute != null)
                                        {
                                                string Attribute2844 = (string)PurchaseOrderItemRet.Attribute.GetValue();
                                        }
                                        //Get value of Cost
                                        if (PurchaseOrderItemRet.Cost != null)
                                        {
                                                double Cost2845 = (double)PurchaseOrderItemRet.Cost.GetValue();
                                        }
                                        //Get value of Desc1
                                        if (PurchaseOrderItemRet.Desc1 != null)
                                        {
                                                string Desc12846 = (string)PurchaseOrderItemRet.Desc1.GetValue();
                                        }
                                        //Get value of Desc2
                                        if (PurchaseOrderItemRet.Desc2 != null)
                                        {
                                                string Desc22847 = (string)PurchaseOrderItemRet.Desc2.GetValue();
                                        }
                                        //Get value of ExtendedCost
                                        if (PurchaseOrderItemRet.ExtendedCost != null)
                                        {
                                                double ExtendedCost2848 = (double)PurchaseOrderItemRet.ExtendedCost.GetValue();
                                        }
                                        //Get value of ItemNumber
                                        if (PurchaseOrderItemRet.ItemNumber != null)
                                        {
                                                int ItemNumber2849 = (int)PurchaseOrderItemRet.ItemNumber.GetValue();
                                        }
                                        //Get value of NumberOfBaseUnits
                                        if (PurchaseOrderItemRet.NumberOfBaseUnits != null)
                                        {
                                                int NumberOfBaseUnits2850 = (int)PurchaseOrderItemRet.NumberOfBaseUnits.GetValue();
                                        }
                                        //Get value of Qty
                                        if (PurchaseOrderItemRet.Qty != null)
                                        {
                                                int Qty2851 = (int)PurchaseOrderItemRet.Qty.GetValue();
                                        }
                                        //Get value of QtyReceived
                                        if (PurchaseOrderItemRet.QtyReceived != null)
                                        {
                                                int QtyReceived2852 = (int)PurchaseOrderItemRet.QtyReceived.GetValue();
                                        }
                                        //Get value of Size
                                        if (PurchaseOrderItemRet.Size != null)
                                        {
                                                string Size2853 = (string)PurchaseOrderItemRet.Size.GetValue();
                                        }
                                        //Get value of UnitOfMeasure
                                        if (PurchaseOrderItemRet.UnitOfMeasure != null)
                                        {
                                                string UnitOfMeasure2854 = (string)PurchaseOrderItemRet.UnitOfMeasure.GetValue();
                                        }
                                        //Get value of UPC
                                        if (PurchaseOrderItemRet.UPC != null)
                                        {
                                                string UPC2855 = (string)PurchaseOrderItemRet.UPC.GetValue();
                                        }
                                }
                        }
                        if (PurchaseOrderRet.DataExtRetList != null)
                        {
                                for (int i2856 = 0; i2856 < PurchaseOrderRet.DataExtRetList.Count; i2856++)
                                {
                                        IDataExtRet DataExtRet = PurchaseOrderRet.DataExtRetList.GetAt(i2856);
                                        //Get value of OwnerID
                                        string OwnerID2857 = (string)DataExtRet.OwnerID.GetValue();
                                        //Get value of DataExtName
                                        string DataExtName2858 = (string)DataExtRet.DataExtName.GetValue();
                                        //Get value of DataExtType
                                        ENDataExtType DataExtType2859 = (ENDataExtType)DataExtRet.DataExtType.GetValue();
                                        //Get value of DataExtValue
                                        string DataExtValue2860 = (string)DataExtRet.DataExtValue.GetValue();
                                }
                        }
                }




        }
}