Modifies an existing Sales Order. You must be careful when modifying line items in the sales 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 Sales Order? <ol>In your SalesOrderMod, supply the TxnID of the sales 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. Reconstruct the line items block. To do this, Insert a separate SalesOrderItemMod 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. If you want to delete any existing line item, simply omit its SalesOrderItemMod aggregate: that will cause the line to be dropped. Wherever you want to add a new line in that existing Sales Order, simply specify out its SalesOrderItemMod aggregate as you want, but use the TxnLineID value of -1 (minus 1). That tells QBPOS that its a new item. </ol>
Request
Response
XMLOPS
VB.NET
C#
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 | <?xml version="1.0" encoding="utf-8"?> <?qbposxml version="4.0"?> <QBPOSXML> <QBPOSXMLMsgsRq onError="stopOnError"> <SalesOrderModRq> <SalesOrderMod> <!-- required --> <TxnID useMacro="MACROTYPE">IDTYPE</TxnID> <!-- required --> <Associate >STRTYPE</Associate> <!-- optional --> <Cashier >STRTYPE</Cashier> <!-- optional --> <CustomerListID useMacro="MACROTYPE">IDTYPE</CustomerListID> <!-- optional --> <Discount >AMTTYPE</Discount> <!-- optional --> <DiscountPercent >FLOATTYPE</DiscountPercent> <!-- optional --> <Instructions >STRTYPE</Instructions> <!-- optional --> <!-- PriceLevelNumber may have one of the following values: 1, 2, 3, 4, 5 --> <PriceLevelNumber >ENUMTYPE</PriceLevelNumber> <!-- optional --> <PromoCode >STRTYPE</PromoCode> <!-- optional --> <SalesOrderNumber >STRTYPE</SalesOrderNumber> <!-- optional --> <SalesOrderStatusDesc >STRTYPE</SalesOrderStatusDesc> <!-- optional --> <!-- SalesOrderType may have one of the following values: SalesOrder, Layaway, WorkOrder, WebOrder --> <SalesOrderType >ENUMTYPE</SalesOrderType> <!-- optional --> <TaxCategory >STRTYPE</TaxCategory> <!-- optional --> <TxnDate >DATETYPE</TxnDate> <!-- optional --> <ShippingInformation> <!-- optional --> <AddressName >STRTYPE</AddressName> <!-- optional --> <City >STRTYPE</City> <!-- optional --> <CompanyName >STRTYPE</CompanyName> <!-- optional --> <Country >STRTYPE</Country> <!-- optional --> <FullName >STRTYPE</FullName> <!-- optional --> <Phone >STRTYPE</Phone> <!-- optional --> <Phone2 >STRTYPE</Phone2> <!-- optional --> <Phone3 >STRTYPE</Phone3> <!-- optional --> <Phone4 >STRTYPE</Phone4> <!-- optional --> <PostalCode >STRTYPE</PostalCode> <!-- optional --> <ShipBy >STRTYPE</ShipBy> <!-- optional --> <Shipping >AMTTYPE</Shipping> <!-- optional --> <State >STRTYPE</State> <!-- optional --> <Street >STRTYPE</Street> <!-- optional --> <Street2 >STRTYPE</Street2> <!-- optional --> </ShippingInformation> <SalesOrderItemMod> <!-- optional, may repeat --> <ListID useMacro="MACROTYPE">IDTYPE</ListID> <!-- optional --> <TxnLineID >INTTYPE</TxnLineID> <!-- required --> <ALU >STRTYPE</ALU> <!-- optional --> <Associate >STRTYPE</Associate> <!-- optional --> <Attribute >STRTYPE</Attribute> <!-- optional --> <Commission >AMTTYPE</Commission> <!-- optional --> <Desc1 >STRTYPE</Desc1> <!-- optional --> <Desc2 >STRTYPE</Desc2> <!-- optional --> <Discount >AMTTYPE</Discount> <!-- optional --> <DiscountPercent >FLOATTYPE</DiscountPercent> <!-- optional --> <DiscountType >STRTYPE</DiscountType> <!-- optional --> <ExtendedPrice >AMTTYPE</ExtendedPrice> <!-- optional --> <Price >AMTTYPE</Price> <!-- optional --> <Qty >QUANTYPE</Qty> <!-- optional --> <SerialNumber >STRTYPE</SerialNumber> <!-- optional --> <Size >STRTYPE</Size> <!-- optional --> <TaxCode >STRTYPE</TaxCode> <!-- optional --> <UnitOfMeasure >STRTYPE</UnitOfMeasure> <!-- optional --> <UPC >STRTYPE</UPC> <!-- optional --> </SalesOrderItemMod> </SalesOrderMod> <IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat --> </SalesOrderModRq> <SalesOrderModRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE"> <SalesOrderRet> <!-- optional --> <TxnID >IDTYPE</TxnID> <!-- optional --> <TimeCreated >DATETIMETYPE</TimeCreated> <!-- optional --> <TimeModified >DATETIMETYPE</TimeModified> <!-- optional --> <Associate >STRTYPE</Associate> <!-- optional --> <BalanceDue >AMTTYPE</BalanceDue> <!-- optional --> <Cashier >STRTYPE</Cashier> <!-- optional --> <CustomerListID >IDTYPE</CustomerListID> <!-- optional --> <DepositBalance >AMTTYPE</DepositBalance> <!-- optional --> <Discount >AMTTYPE</Discount> <!-- optional --> <DiscountPercent >FLOATTYPE</DiscountPercent> <!-- optional --> <Instructions >STRTYPE</Instructions> <!-- optional --> <ItemsCount >INTTYPE</ItemsCount> <!-- optional --> <!-- PriceLevelNumber may have one of the following values: 1, 2, 3, 4, 5 --> <PriceLevelNumber >ENUMTYPE</PriceLevelNumber> <!-- optional --> <PromoCode >STRTYPE</PromoCode> <!-- optional --> <Qty >QUANTYPE</Qty> <!-- optional --> <SalesOrderNumber >STRTYPE</SalesOrderNumber> <!-- optional --> <SalesOrderStatusDesc >STRTYPE</SalesOrderStatusDesc> <!-- optional --> <!-- SalesOrderType may have one of the following values: SalesOrder, Layaway, WorkOrder, WebOrder --> <SalesOrderType >ENUMTYPE</SalesOrderType> <!-- optional --> <!-- StoreExchangeStatus may have one of the following values: Modified, Sent, Acknowledged --> <StoreExchangeStatus >ENUMTYPE</StoreExchangeStatus> <!-- optional --> <Subtotal >AMTTYPE</Subtotal> <!-- optional --> <TaxAmount >AMTTYPE</TaxAmount> <!-- optional --> <TaxCategory >STRTYPE</TaxCategory> <!-- optional --> <TaxPercentage >FLOATTYPE</TaxPercentage> <!-- optional --> <Total >AMTTYPE</Total> <!-- optional --> <TxnDate >DATETYPE</TxnDate> <!-- optional --> <UnfilledPercent >FLOATTYPE</UnfilledPercent> <!-- optional --> <BillingInformation> <!-- optional --> <City >STRTYPE</City> <!-- optional --> <CompanyName >STRTYPE</CompanyName> <!-- optional --> <Country >STRTYPE</Country> <!-- optional --> <FirstName >STRTYPE</FirstName> <!-- optional --> <LastName >STRTYPE</LastName> <!-- optional --> <Phone >STRTYPE</Phone> <!-- optional --> <Phone2 >STRTYPE</Phone2> <!-- optional --> <Phone3 >STRTYPE</Phone3> <!-- optional --> <Phone4 >STRTYPE</Phone4> <!-- optional --> <PostalCode >STRTYPE</PostalCode> <!-- optional --> <Salutation >STRTYPE</Salutation> <!-- optional --> <State >STRTYPE</State> <!-- optional --> <Street >STRTYPE</Street> <!-- optional --> <Street2 >STRTYPE</Street2> <!-- optional --> <WebNumber >STRTYPE</WebNumber> <!-- optional --> </BillingInformation> <ShippingInformation> <!-- optional --> <AddressName >STRTYPE</AddressName> <!-- optional --> <City >STRTYPE</City> <!-- optional --> <CompanyName >STRTYPE</CompanyName> <!-- optional --> <Country >STRTYPE</Country> <!-- optional --> <FullName >STRTYPE</FullName> <!-- optional --> <Phone >STRTYPE</Phone> <!-- optional --> <Phone2 >STRTYPE</Phone2> <!-- optional --> <Phone3 >STRTYPE</Phone3> <!-- optional --> <Phone4 >STRTYPE</Phone4> <!-- optional --> <PostalCode >STRTYPE</PostalCode> <!-- optional --> <ShipBy >STRTYPE</ShipBy> <!-- optional --> <Shipping >AMTTYPE</Shipping> <!-- optional --> <State >STRTYPE</State> <!-- optional --> <Street >STRTYPE</Street> <!-- optional --> <Street2 >STRTYPE</Street2> <!-- optional --> </ShippingInformation> <SalesOrderItemRet> <!-- optional, may repeat --> <ListID >IDTYPE</ListID> <!-- optional --> <TxnLineID >INTTYPE</TxnLineID> <!-- optional --> <ALU >STRTYPE</ALU> <!-- optional --> <Associate >STRTYPE</Associate> <!-- optional --> <Attribute >STRTYPE</Attribute> <!-- optional --> <Commission >AMTTYPE</Commission> <!-- optional --> <Desc1 >STRTYPE</Desc1> <!-- optional --> <Desc2 >STRTYPE</Desc2> <!-- optional --> <Discount >AMTTYPE</Discount> <!-- optional --> <DiscountPercent >FLOATTYPE</DiscountPercent> <!-- optional --> <DiscountType >STRTYPE</DiscountType> <!-- optional --> <!-- DiscountSource may have one of the following values: None, Pricing, Manual, Reward --> <DiscountSource >ENUMTYPE</DiscountSource> <!-- optional --> <ExtendedPrice >AMTTYPE</ExtendedPrice> <!-- optional --> <ExtendedTax >AMTTYPE</ExtendedTax> <!-- optional --> <ItemNumber >INTTYPE</ItemNumber> <!-- optional --> <NumberOfBaseUnits >QUANTYPE</NumberOfBaseUnits> <!-- optional --> <Price >AMTTYPE</Price> <!-- optional --> <!-- PriceLevelNumber may have one of the following values: 1, 2, 3, 4, 5 --> <PriceLevelNumber >ENUMTYPE</PriceLevelNumber> <!-- optional --> <Qty >QUANTYPE</Qty> <!-- optional --> <QtySold >QUANTYPE</QtySold> <!-- optional --> <SerialNumber >STRTYPE</SerialNumber> <!-- optional --> <Size >STRTYPE</Size> <!-- optional --> <TaxAmount >AMTTYPE</TaxAmount> <!-- optional --> <TaxCode >STRTYPE</TaxCode> <!-- optional --> <TaxPercentage >FLOATTYPE</TaxPercentage> <!-- optional --> <UnitOfMeasure >STRTYPE</UnitOfMeasure> <!-- optional --> <UPC >STRTYPE</UPC> <!-- optional --> <WebDesc >STRTYPE</WebDesc> <!-- optional --> <Manufacturer >STRTYPE</Manufacturer> <!-- optional --> <Weight >FLOATTYPE</Weight> <!-- optional --> <WebSKU >STRTYPE</WebSKU> <!-- optional --> </SalesOrderItemRet> <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> </SalesOrderRet> </SalesOrderModRs> </QBPOSXMLMsgsRq> </QBPOSXML> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 | '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 SampleSalesOrderMod
Public Sub DoSalesOrderMod()
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
BuildSalesOrderModRq(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
WalkSalesOrderModRs(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 BuildSalesOrderModRq(requestMsgSet as IMsgSetRequest)
Dim SalesOrderModRq as ISalesOrderMod
SalesOrderModRq= requestMsgSet.AppendSalesOrderModRq()
'Set field value for TxnID
SalesOrderModRq.TxnID.SetValue("200000-1011023419")
'Set attributes
'Set field value for TxnID to use Macro
SalesOrderModRq.TxnID.SetValueUseMacro("200000-1011023419")
'Set field value for Associate
SalesOrderModRq.Associate.SetValue("ab")
'Set field value for Cashier
SalesOrderModRq.Cashier.SetValue("ab")
'Set field value for CustomerListID
SalesOrderModRq.CustomerListID.SetValue("200000-1011023419")
'Set attributes
'Set field value for CustomerListID to use Macro
SalesOrderModRq.CustomerListID.SetValueUseMacro("200000-1011023419")
'Set field value for Discount
SalesOrderModRq.Discount.SetValue(10.01)
'Set field value for DiscountPercent
SalesOrderModRq.DiscountPercent.SetValue(12.34)
'Set field value for Instructions
SalesOrderModRq.Instructions.SetValue("ab")
'Set field value for PriceLevelNumber
SalesOrderModRq.PriceLevelNumber.SetValue(ENPriceLevelNumber.pln1)
'Set field value for PromoCode
SalesOrderModRq.PromoCode.SetValue("ab")
'Set field value for SalesOrderNumber
SalesOrderModRq.SalesOrderNumber.SetValue("ab")
'Set field value for SalesOrderStatusDesc
SalesOrderModRq.SalesOrderStatusDesc.SetValue("ab")
'Set field value for SalesOrderType
SalesOrderModRq.SalesOrderType.SetValue(ENSalesOrderType.sotSalesOrder)
'Set field value for TaxCategory
SalesOrderModRq.TaxCategory.SetValue("ab")
'Set field value for TxnDate
SalesOrderModRq.TxnDate.SetValue(DateTime.Parse("12/15/2007"))
'Set field value for AddressName
SalesOrderModRq.ShippingInformation.AddressName.SetValue("ab")
'Set field value for City
SalesOrderModRq.ShippingInformation.City.SetValue("ab")
'Set field value for CompanyName
SalesOrderModRq.ShippingInformation.CompanyName.SetValue("ab")
'Set field value for Country
SalesOrderModRq.ShippingInformation.Country.SetValue("ab")
'Set field value for FullName
SalesOrderModRq.ShippingInformation.FullName.SetValue("ab")
'Set field value for Phone
SalesOrderModRq.ShippingInformation.Phone.SetValue("ab")
'Set field value for Phone2
SalesOrderModRq.ShippingInformation.Phone2.SetValue("ab")
'Set field value for Phone3
SalesOrderModRq.ShippingInformation.Phone3.SetValue("ab")
'Set field value for Phone4
SalesOrderModRq.ShippingInformation.Phone4.SetValue("ab")
'Set field value for PostalCode
SalesOrderModRq.ShippingInformation.PostalCode.SetValue("ab")
'Set field value for ShipBy
SalesOrderModRq.ShippingInformation.ShipBy.SetValue("ab")
'Set field value for Shipping
SalesOrderModRq.ShippingInformation.Shipping.SetValue(10.01)
'Set field value for State
SalesOrderModRq.ShippingInformation.State.SetValue("ab")
'Set field value for Street
SalesOrderModRq.ShippingInformation.Street.SetValue("ab")
'Set field value for Street2
SalesOrderModRq.ShippingInformation.Street2.SetValue("ab")
Dim SalesOrderItemMod3203 as ISalesOrderItemMod
SalesOrderItemMod3203=SalesOrderModRq.SalesOrderItemModList.Append()
'Set field value for ListID
SalesOrderItemMod3203.ListID.SetValue("200000-1011023419")
'Set attributes
'Set field value for ListID to use Macro
SalesOrderItemMod3203.ListID.SetValueUseMacro("200000-1011023419")
'Set field value for TxnLineID
SalesOrderItemMod3203.TxnLineID.SetValue(6)
'Set field value for ALU
SalesOrderItemMod3203.ALU.SetValue("ab")
'Set field value for Associate
SalesOrderItemMod3203.Associate.SetValue("ab")
'Set field value for Attribute
SalesOrderItemMod3203.Attribute.SetValue("ab")
'Set field value for Commission
SalesOrderItemMod3203.Commission.SetValue(10.01)
'Set field value for Desc1
SalesOrderItemMod3203.Desc1.SetValue("ab")
'Set field value for Desc2
SalesOrderItemMod3203.Desc2.SetValue("ab")
'Set field value for Discount
SalesOrderItemMod3203.Discount.SetValue(10.01)
'Set field value for DiscountPercent
SalesOrderItemMod3203.DiscountPercent.SetValue(12.34)
'Set field value for DiscountType
SalesOrderItemMod3203.DiscountType.SetValue("ab")
'Set field value for ExtendedPrice
SalesOrderItemMod3203.ExtendedPrice.SetValue(10.01)
'Set field value for Price
SalesOrderItemMod3203.Price.SetValue(10.01)
'Set field value for Qty
SalesOrderItemMod3203.Qty.SetValue(2)
'Set field value for SerialNumber
SalesOrderItemMod3203.SerialNumber.SetValue("ab")
'Set field value for Size
SalesOrderItemMod3203.Size.SetValue("ab")
'Set field value for TaxCode
SalesOrderItemMod3203.TaxCode.SetValue("ab")
'Set field value for UnitOfMeasure
SalesOrderItemMod3203.UnitOfMeasure.SetValue("ab")
'Set field value for UPC
SalesOrderItemMod3203.UPC.SetValue("ab")
'Set field value for IncludeRetElementList
'May create more than one of these if needed
SalesOrderModRq.IncludeRetElementList.Add("ab")
End Sub
Public Sub WalkSalesOrderModRs( 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.rtSalesOrderModRs) then
'upcast to more specific type here, this is safe because we checked with response.Type check above
Dim SalesOrderRet as ISalesOrderRet
SalesOrderRet = CType(response.Detail,ISalesOrderRet)
WalkSalesOrderRet(SalesOrderRet)
End If
End If
End If
Next j
End Sub
Public Sub WalkSalesOrderRet(SalesOrderRet as ISalesOrderRet)
if (SalesOrderRet is nothing) then
Exit Sub
End If
'Go through all the elements of ISalesOrderRet
'Get value of TxnID
if ( not SalesOrderRet.TxnID is nothing) then
Dim TxnID3204 as String
TxnID3204 = SalesOrderRet.TxnID.GetValue()
End If
'Get value of TimeCreated
if ( not SalesOrderRet.TimeCreated is nothing) then
Dim TimeCreated3205 as DateTime
TimeCreated3205 = SalesOrderRet.TimeCreated.GetValue()
End If
'Get value of TimeModified
if ( not SalesOrderRet.TimeModified is nothing) then
Dim TimeModified3206 as DateTime
TimeModified3206 = SalesOrderRet.TimeModified.GetValue()
End If
'Get value of Associate
if ( not SalesOrderRet.Associate is nothing) then
Dim Associate3207 as String
Associate3207 = SalesOrderRet.Associate.GetValue()
End If
'Get value of BalanceDue
if ( not SalesOrderRet.BalanceDue is nothing) then
Dim BalanceDue3208 as Double
BalanceDue3208 = SalesOrderRet.BalanceDue.GetValue()
End If
'Get value of Cashier
if ( not SalesOrderRet.Cashier is nothing) then
Dim Cashier3209 as String
Cashier3209 = SalesOrderRet.Cashier.GetValue()
End If
'Get value of CustomerListID
if ( not SalesOrderRet.CustomerListID is nothing) then
Dim CustomerListID3210 as String
CustomerListID3210 = SalesOrderRet.CustomerListID.GetValue()
End If
'Get value of DepositBalance
if ( not SalesOrderRet.DepositBalance is nothing) then
Dim DepositBalance3211 as Double
DepositBalance3211 = SalesOrderRet.DepositBalance.GetValue()
End If
'Get value of Discount
if ( not SalesOrderRet.Discount is nothing) then
Dim Discount3212 as Double
Discount3212 = SalesOrderRet.Discount.GetValue()
End If
'Get value of DiscountPercent
if ( not SalesOrderRet.DiscountPercent is nothing) then
Dim DiscountPercent3213 as Single
DiscountPercent3213 = SalesOrderRet.DiscountPercent.GetValue()
End If
'Get value of Instructions
if ( not SalesOrderRet.Instructions is nothing) then
Dim Instructions3214 as String
Instructions3214 = SalesOrderRet.Instructions.GetValue()
End If
'Get value of ItemsCount
if ( not SalesOrderRet.ItemsCount is nothing) then
Dim ItemsCount3215 as Integer
ItemsCount3215 = SalesOrderRet.ItemsCount.GetValue()
End If
'Get value of PriceLevelNumber
if ( not SalesOrderRet.PriceLevelNumber is nothing) then
Dim PriceLevelNumber3216 as ENPriceLevelNumber
PriceLevelNumber3216 = SalesOrderRet.PriceLevelNumber.GetValue()
End If
'Get value of PromoCode
if ( not SalesOrderRet.PromoCode is nothing) then
Dim PromoCode3217 as String
PromoCode3217 = SalesOrderRet.PromoCode.GetValue()
End If
'Get value of Qty
if ( not SalesOrderRet.Qty is nothing) then
Dim Qty3218 as Double
Qty3218 = SalesOrderRet.Qty.GetValue()
End If
'Get value of SalesOrderNumber
if ( not SalesOrderRet.SalesOrderNumber is nothing) then
Dim SalesOrderNumber3219 as String
SalesOrderNumber3219 = SalesOrderRet.SalesOrderNumber.GetValue()
End If
'Get value of SalesOrderStatusDesc
if ( not SalesOrderRet.SalesOrderStatusDesc is nothing) then
Dim SalesOrderStatusDesc3220 as String
SalesOrderStatusDesc3220 = SalesOrderRet.SalesOrderStatusDesc.GetValue()
End If
'Get value of SalesOrderType
if ( not SalesOrderRet.SalesOrderType is nothing) then
Dim SalesOrderType3221 as ENSalesOrderType
SalesOrderType3221 = SalesOrderRet.SalesOrderType.GetValue()
End If
'Get value of StoreExchangeStatus
if ( not SalesOrderRet.StoreExchangeStatus is nothing) then
Dim StoreExchangeStatus3222 as ENStoreExchangeStatus
StoreExchangeStatus3222 = SalesOrderRet.StoreExchangeStatus.GetValue()
End If
'Get value of Subtotal
if ( not SalesOrderRet.Subtotal is nothing) then
Dim Subtotal3223 as Double
Subtotal3223 = SalesOrderRet.Subtotal.GetValue()
End If
'Get value of TaxAmount
if ( not SalesOrderRet.TaxAmount is nothing) then
Dim TaxAmount3224 as Double
TaxAmount3224 = SalesOrderRet.TaxAmount.GetValue()
End If
'Get value of TaxCategory
if ( not SalesOrderRet.TaxCategory is nothing) then
Dim TaxCategory3225 as String
TaxCategory3225 = SalesOrderRet.TaxCategory.GetValue()
End If
'Get value of TaxPercentage
if ( not SalesOrderRet.TaxPercentage is nothing) then
Dim TaxPercentage3226 as Single
TaxPercentage3226 = SalesOrderRet.TaxPercentage.GetValue()
End If
'Get value of Total
if ( not SalesOrderRet.Total is nothing) then
Dim Total3227 as Double
Total3227 = SalesOrderRet.Total.GetValue()
End If
'Get value of TxnDate
if ( not SalesOrderRet.TxnDate is nothing) then
Dim TxnDate3228 as DateTime
TxnDate3228 = SalesOrderRet.TxnDate.GetValue()
End If
'Get value of UnfilledPercent
if ( not SalesOrderRet.UnfilledPercent is nothing) then
Dim UnfilledPercent3229 as Single
UnfilledPercent3229 = SalesOrderRet.UnfilledPercent.GetValue()
End If
if (not SalesOrderRet.BillingInformation is nothing) then
'Get value of City
if ( not SalesOrderRet.BillingInformation.City is nothing) then
Dim City3230 as String
City3230 = SalesOrderRet.BillingInformation.City.GetValue()
End If
'Get value of CompanyName
if ( not SalesOrderRet.BillingInformation.CompanyName is nothing) then
Dim CompanyName3231 as String
CompanyName3231 = SalesOrderRet.BillingInformation.CompanyName.GetValue()
End If
'Get value of Country
if ( not SalesOrderRet.BillingInformation.Country is nothing) then
Dim Country3232 as String
Country3232 = SalesOrderRet.BillingInformation.Country.GetValue()
End If
'Get value of FirstName
if ( not SalesOrderRet.BillingInformation.FirstName is nothing) then
Dim FirstName3233 as String
FirstName3233 = SalesOrderRet.BillingInformation.FirstName.GetValue()
End If
'Get value of LastName
if ( not SalesOrderRet.BillingInformation.LastName is nothing) then
Dim LastName3234 as String
LastName3234 = SalesOrderRet.BillingInformation.LastName.GetValue()
End If
'Get value of Phone
if ( not SalesOrderRet.BillingInformation.Phone is nothing) then
Dim Phone3235 as String
Phone3235 = SalesOrderRet.BillingInformation.Phone.GetValue()
End If
'Get value of Phone2
if ( not SalesOrderRet.BillingInformation.Phone2 is nothing) then
Dim Phone23236 as String
Phone23236 = SalesOrderRet.BillingInformation.Phone2.GetValue()
End If
'Get value of Phone3
if ( not SalesOrderRet.BillingInformation.Phone3 is nothing) then
Dim Phone33237 as String
Phone33237 = SalesOrderRet.BillingInformation.Phone3.GetValue()
End If
'Get value of Phone4
if ( not SalesOrderRet.BillingInformation.Phone4 is nothing) then
Dim Phone43238 as String
Phone43238 = SalesOrderRet.BillingInformation.Phone4.GetValue()
End If
'Get value of PostalCode
if ( not SalesOrderRet.BillingInformation.PostalCode is nothing) then
Dim PostalCode3239 as String
PostalCode3239 = SalesOrderRet.BillingInformation.PostalCode.GetValue()
End If
'Get value of Salutation
if ( not SalesOrderRet.BillingInformation.Salutation is nothing) then
Dim Salutation3240 as String
Salutation3240 = SalesOrderRet.BillingInformation.Salutation.GetValue()
End If
'Get value of State
if ( not SalesOrderRet.BillingInformation.State is nothing) then
Dim State3241 as String
State3241 = SalesOrderRet.BillingInformation.State.GetValue()
End If
'Get value of Street
if ( not SalesOrderRet.BillingInformation.Street is nothing) then
Dim Street3242 as String
Street3242 = SalesOrderRet.BillingInformation.Street.GetValue()
End If
'Get value of Street2
if ( not SalesOrderRet.BillingInformation.Street2 is nothing) then
Dim Street23243 as String
Street23243 = SalesOrderRet.BillingInformation.Street2.GetValue()
End If
'Get value of WebNumber
if ( not SalesOrderRet.BillingInformation.WebNumber is nothing) then
Dim WebNumber3244 as String
WebNumber3244 = SalesOrderRet.BillingInformation.WebNumber.GetValue()
End If
End If
if (not SalesOrderRet.ShippingInformation is nothing) then
'Get value of AddressName
if ( not SalesOrderRet.ShippingInformation.AddressName is nothing) then
Dim AddressName3245 as String
AddressName3245 = SalesOrderRet.ShippingInformation.AddressName.GetValue()
End If
'Get value of City
if ( not SalesOrderRet.ShippingInformation.City is nothing) then
Dim City3246 as String
City3246 = SalesOrderRet.ShippingInformation.City.GetValue()
End If
'Get value of CompanyName
if ( not SalesOrderRet.ShippingInformation.CompanyName is nothing) then
Dim CompanyName3247 as String
CompanyName3247 = SalesOrderRet.ShippingInformation.CompanyName.GetValue()
End If
'Get value of Country
if ( not SalesOrderRet.ShippingInformation.Country is nothing) then
Dim Country3248 as String
Country3248 = SalesOrderRet.ShippingInformation.Country.GetValue()
End If
'Get value of FullName
if ( not SalesOrderRet.ShippingInformation.FullName is nothing) then
Dim FullName3249 as String
FullName3249 = SalesOrderRet.ShippingInformation.FullName.GetValue()
End If
'Get value of Phone
if ( not SalesOrderRet.ShippingInformation.Phone is nothing) then
Dim Phone3250 as String
Phone3250 = SalesOrderRet.ShippingInformation.Phone.GetValue()
End If
'Get value of Phone2
if ( not SalesOrderRet.ShippingInformation.Phone2 is nothing) then
Dim Phone23251 as String
Phone23251 = SalesOrderRet.ShippingInformation.Phone2.GetValue()
End If
'Get value of Phone3
if ( not SalesOrderRet.ShippingInformation.Phone3 is nothing) then
Dim Phone33252 as String
Phone33252 = SalesOrderRet.ShippingInformation.Phone3.GetValue()
End If
'Get value of Phone4
if ( not SalesOrderRet.ShippingInformation.Phone4 is nothing) then
Dim Phone43253 as String
Phone43253 = SalesOrderRet.ShippingInformation.Phone4.GetValue()
End If
'Get value of PostalCode
if ( not SalesOrderRet.ShippingInformation.PostalCode is nothing) then
Dim PostalCode3254 as String
PostalCode3254 = SalesOrderRet.ShippingInformation.PostalCode.GetValue()
End If
'Get value of ShipBy
if ( not SalesOrderRet.ShippingInformation.ShipBy is nothing) then
Dim ShipBy3255 as String
ShipBy3255 = SalesOrderRet.ShippingInformation.ShipBy.GetValue()
End If
'Get value of Shipping
if ( not SalesOrderRet.ShippingInformation.Shipping is nothing) then
Dim Shipping3256 as Double
Shipping3256 = SalesOrderRet.ShippingInformation.Shipping.GetValue()
End If
'Get value of State
if ( not SalesOrderRet.ShippingInformation.State is nothing) then
Dim State3257 as String
State3257 = SalesOrderRet.ShippingInformation.State.GetValue()
End If
'Get value of Street
if ( not SalesOrderRet.ShippingInformation.Street is nothing) then
Dim Street3258 as String
Street3258 = SalesOrderRet.ShippingInformation.Street.GetValue()
End If
'Get value of Street2
if ( not SalesOrderRet.ShippingInformation.Street2 is nothing) then
Dim Street23259 as String
Street23259 = SalesOrderRet.ShippingInformation.Street2.GetValue()
End If
End If
if (not SalesOrderRet.SalesOrderItemRetList is nothing)
Dim i3260 as Integer
for i3260 = 0 to SalesOrderRet.SalesOrderItemRetList.Count - 1
Dim SalesOrderItemRet as ISalesOrderItemRet
SalesOrderItemRet = SalesOrderRet.SalesOrderItemRetList.GetAt(i3260)
'Get value of ListID
if ( not SalesOrderItemRet.ListID is nothing) then
Dim ListID3261 as String
ListID3261 = SalesOrderItemRet.ListID.GetValue()
End If
'Get value of TxnLineID
if ( not SalesOrderItemRet.TxnLineID is nothing) then
Dim TxnLineID3262 as Integer
TxnLineID3262 = SalesOrderItemRet.TxnLineID.GetValue()
End If
'Get value of ALU
if ( not SalesOrderItemRet.ALU is nothing) then
Dim ALU3263 as String
ALU3263 = SalesOrderItemRet.ALU.GetValue()
End If
'Get value of Associate
if ( not SalesOrderItemRet.Associate is nothing) then
Dim Associate3264 as String
Associate3264 = SalesOrderItemRet.Associate.GetValue()
End If
'Get value of Attribute
if ( not SalesOrderItemRet.Attribute is nothing) then
Dim Attribute3265 as String
Attribute3265 = SalesOrderItemRet.Attribute.GetValue()
End If
'Get value of Commission
if ( not SalesOrderItemRet.Commission is nothing) then
Dim Commission3266 as Double
Commission3266 = SalesOrderItemRet.Commission.GetValue()
End If
'Get value of Desc1
if ( not SalesOrderItemRet.Desc1 is nothing) then
Dim Desc13267 as String
Desc13267 = SalesOrderItemRet.Desc1.GetValue()
End If
'Get value of Desc2
if ( not SalesOrderItemRet.Desc2 is nothing) then
Dim Desc23268 as String
Desc23268 = SalesOrderItemRet.Desc2.GetValue()
End If
'Get value of Discount
if ( not SalesOrderItemRet.Discount is nothing) then
Dim Discount3269 as Double
Discount3269 = SalesOrderItemRet.Discount.GetValue()
End If
'Get value of DiscountPercent
if ( not SalesOrderItemRet.DiscountPercent is nothing) then
Dim DiscountPercent3270 as Single
DiscountPercent3270 = SalesOrderItemRet.DiscountPercent.GetValue()
End If
'Get value of DiscountType
if ( not SalesOrderItemRet.DiscountType is nothing) then
Dim DiscountType3271 as String
DiscountType3271 = SalesOrderItemRet.DiscountType.GetValue()
End If
'Get value of DiscountSource
if ( not SalesOrderItemRet.DiscountSource is nothing) then
Dim DiscountSource3272 as ENDiscountSource
DiscountSource3272 = SalesOrderItemRet.DiscountSource.GetValue()
End If
'Get value of ExtendedPrice
if ( not SalesOrderItemRet.ExtendedPrice is nothing) then
Dim ExtendedPrice3273 as Double
ExtendedPrice3273 = SalesOrderItemRet.ExtendedPrice.GetValue()
End If
'Get value of ExtendedTax
if ( not SalesOrderItemRet.ExtendedTax is nothing) then
Dim ExtendedTax3274 as Double
ExtendedTax3274 = SalesOrderItemRet.ExtendedTax.GetValue()
End If
'Get value of ItemNumber
if ( not SalesOrderItemRet.ItemNumber is nothing) then
Dim ItemNumber3275 as Integer
ItemNumber3275 = SalesOrderItemRet.ItemNumber.GetValue()
End If
'Get value of NumberOfBaseUnits
if ( not SalesOrderItemRet.NumberOfBaseUnits is nothing) then
Dim NumberOfBaseUnits3276 as Double
NumberOfBaseUnits3276 = SalesOrderItemRet.NumberOfBaseUnits.GetValue()
End If
'Get value of Price
if ( not SalesOrderItemRet.Price is nothing) then
Dim Price3277 as Double
Price3277 = SalesOrderItemRet.Price.GetValue()
End If
'Get value of PriceLevelNumber
if ( not SalesOrderItemRet.PriceLevelNumber is nothing) then
Dim PriceLevelNumber3278 as ENPriceLevelNumber
PriceLevelNumber3278 = SalesOrderItemRet.PriceLevelNumber.GetValue()
End If
'Get value of Qty
if ( not SalesOrderItemRet.Qty is nothing) then
Dim Qty3279 as Double
Qty3279 = SalesOrderItemRet.Qty.GetValue()
End If
'Get value of QtySold
if ( not SalesOrderItemRet.QtySold is nothing) then
Dim QtySold3280 as Double
QtySold3280 = SalesOrderItemRet.QtySold.GetValue()
End If
'Get value of SerialNumber
if ( not SalesOrderItemRet.SerialNumber is nothing) then
Dim SerialNumber3281 as String
SerialNumber3281 = SalesOrderItemRet.SerialNumber.GetValue()
End If
'Get value of Size
if ( not SalesOrderItemRet.Size is nothing) then
Dim Size3282 as String
Size3282 = SalesOrderItemRet.Size.GetValue()
End If
'Get value of TaxAmount
if ( not SalesOrderItemRet.TaxAmount is nothing) then
Dim TaxAmount3283 as Double
TaxAmount3283 = SalesOrderItemRet.TaxAmount.GetValue()
End If
'Get value of TaxCode
if ( not SalesOrderItemRet.TaxCode is nothing) then
Dim TaxCode3284 as String
TaxCode3284 = SalesOrderItemRet.TaxCode.GetValue()
End If
'Get value of TaxPercentage
if ( not SalesOrderItemRet.TaxPercentage is nothing) then
Dim TaxPercentage3285 as Single
TaxPercentage3285 = SalesOrderItemRet.TaxPercentage.GetValue()
End If
'Get value of UnitOfMeasure
if ( not SalesOrderItemRet.UnitOfMeasure is nothing) then
Dim UnitOfMeasure3286 as String
UnitOfMeasure3286 = SalesOrderItemRet.UnitOfMeasure.GetValue()
End If
'Get value of UPC
if ( not SalesOrderItemRet.UPC is nothing) then
Dim UPC3287 as String
UPC3287 = SalesOrderItemRet.UPC.GetValue()
End If
'Get value of WebDesc
if ( not SalesOrderItemRet.WebDesc is nothing) then
Dim WebDesc3288 as String
WebDesc3288 = SalesOrderItemRet.WebDesc.GetValue()
End If
'Get value of Manufacturer
if ( not SalesOrderItemRet.Manufacturer is nothing) then
Dim Manufacturer3289 as String
Manufacturer3289 = SalesOrderItemRet.Manufacturer.GetValue()
End If
'Get value of Weight
if ( not SalesOrderItemRet.Weight is nothing) then
Dim Weight3290 as Single
Weight3290 = SalesOrderItemRet.Weight.GetValue()
End If
'Get value of WebSKU
if ( not SalesOrderItemRet.WebSKU is nothing) then
Dim WebSKU3291 as String
WebSKU3291 = SalesOrderItemRet.WebSKU.GetValue()
End If
Next i3260
End If
if (not SalesOrderRet.DataExtRetList is nothing)
Dim i3292 as Integer
for i3292 = 0 to SalesOrderRet.DataExtRetList.Count - 1
Dim DataExtRet as IDataExtRet
DataExtRet = SalesOrderRet.DataExtRetList.GetAt(i3292)
'Get value of OwnerID
Dim OwnerID3293 as String
OwnerID3293 = DataExtRet.OwnerID.GetValue()
'Get value of DataExtName
Dim DataExtName3294 as String
DataExtName3294 = DataExtRet.DataExtName.GetValue()
'Get value of DataExtType
Dim DataExtType3295 as ENDataExtType
DataExtType3295 = DataExtRet.DataExtType.GetValue()
'Get value of DataExtValue
Dim DataExtValue3296 as String
DataExtValue3296 = DataExtRet.DataExtValue.GetValue()
Next i3292
End If
End Sub
End Class
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 | //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 SampleSalesOrderMod { public void DoSalesOrderMod() { 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; BuildSalesOrderModRq(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; WalkSalesOrderModRs(responseMsgSet); } catch (Exception e) { MessageBox.Show(e.Message, "Error"); if (sessionBegun) { sessionManager.EndSession(); } if (connectionOpen) { sessionManager.CloseConnection(); } } } void BuildSalesOrderModRq(IMsgSetRequest requestMsgSet) { ISalesOrderMod SalesOrderModRq= requestMsgSet.AppendSalesOrderModRq(); //Set field value for TxnID SalesOrderModRq.TxnID.SetValue("200000-1011023419"); //Set attributes //Set field value for TxnID to use Macro SalesOrderModRq.TxnID.SetValueUseMacro("200000-1011023419"); //Set field value for Associate SalesOrderModRq.Associate.SetValue("ab"); //Set field value for Cashier SalesOrderModRq.Cashier.SetValue("ab"); //Set field value for CustomerListID SalesOrderModRq.CustomerListID.SetValue("200000-1011023419"); //Set attributes //Set field value for CustomerListID to use Macro SalesOrderModRq.CustomerListID.SetValueUseMacro("200000-1011023419"); //Set field value for Discount SalesOrderModRq.Discount.SetValue(10.01); //Set field value for DiscountPercent SalesOrderModRq.DiscountPercent.SetValue(12.34F); //Set field value for Instructions SalesOrderModRq.Instructions.SetValue("ab"); //Set field value for PriceLevelNumber SalesOrderModRq.PriceLevelNumber.SetValue(ENPriceLevelNumber.pln1); //Set field value for PromoCode SalesOrderModRq.PromoCode.SetValue("ab"); //Set field value for SalesOrderNumber SalesOrderModRq.SalesOrderNumber.SetValue("ab"); //Set field value for SalesOrderStatusDesc SalesOrderModRq.SalesOrderStatusDesc.SetValue("ab"); //Set field value for SalesOrderType SalesOrderModRq.SalesOrderType.SetValue(ENSalesOrderType.sotSalesOrder); //Set field value for TaxCategory SalesOrderModRq.TaxCategory.SetValue("ab"); //Set field value for TxnDate SalesOrderModRq.TxnDate.SetValue(DateTime.Parse("12/15/2007")); //Set field value for AddressName SalesOrderModRq.ShippingInformation.AddressName.SetValue("ab"); //Set field value for City SalesOrderModRq.ShippingInformation.City.SetValue("ab"); //Set field value for CompanyName SalesOrderModRq.ShippingInformation.CompanyName.SetValue("ab"); //Set field value for Country SalesOrderModRq.ShippingInformation.Country.SetValue("ab"); //Set field value for FullName SalesOrderModRq.ShippingInformation.FullName.SetValue("ab"); //Set field value for Phone SalesOrderModRq.ShippingInformation.Phone.SetValue("ab"); //Set field value for Phone2 SalesOrderModRq.ShippingInformation.Phone2.SetValue("ab"); //Set field value for Phone3 SalesOrderModRq.ShippingInformation.Phone3.SetValue("ab"); //Set field value for Phone4 SalesOrderModRq.ShippingInformation.Phone4.SetValue("ab"); //Set field value for PostalCode SalesOrderModRq.ShippingInformation.PostalCode.SetValue("ab"); //Set field value for ShipBy SalesOrderModRq.ShippingInformation.ShipBy.SetValue("ab"); //Set field value for Shipping SalesOrderModRq.ShippingInformation.Shipping.SetValue(10.01); //Set field value for State SalesOrderModRq.ShippingInformation.State.SetValue("ab"); //Set field value for Street SalesOrderModRq.ShippingInformation.Street.SetValue("ab"); //Set field value for Street2 SalesOrderModRq.ShippingInformation.Street2.SetValue("ab"); ISalesOrderItemMod SalesOrderItemMod3297=SalesOrderModRq.SalesOrderItemModList.Append(); //Set field value for ListID SalesOrderItemMod3297.ListID.SetValue("200000-1011023419"); //Set attributes //Set field value for ListID to use Macro SalesOrderItemMod3297.ListID.SetValueUseMacro("200000-1011023419"); //Set field value for TxnLineID SalesOrderItemMod3297.TxnLineID.SetValue(6); //Set field value for ALU SalesOrderItemMod3297.ALU.SetValue("ab"); //Set field value for Associate SalesOrderItemMod3297.Associate.SetValue("ab"); //Set field value for Attribute SalesOrderItemMod3297.Attribute.SetValue("ab"); //Set field value for Commission SalesOrderItemMod3297.Commission.SetValue(10.01); //Set field value for Desc1 SalesOrderItemMod3297.Desc1.SetValue("ab"); //Set field value for Desc2 SalesOrderItemMod3297.Desc2.SetValue("ab"); //Set field value for Discount SalesOrderItemMod3297.Discount.SetValue(10.01); //Set field value for DiscountPercent SalesOrderItemMod3297.DiscountPercent.SetValue(12.34F); //Set field value for DiscountType SalesOrderItemMod3297.DiscountType.SetValue("ab"); //Set field value for ExtendedPrice SalesOrderItemMod3297.ExtendedPrice.SetValue(10.01); //Set field value for Price SalesOrderItemMod3297.Price.SetValue(10.01); //Set field value for Qty SalesOrderItemMod3297.Qty.SetValue(2); //Set field value for SerialNumber SalesOrderItemMod3297.SerialNumber.SetValue("ab"); //Set field value for Size SalesOrderItemMod3297.Size.SetValue("ab"); //Set field value for TaxCode SalesOrderItemMod3297.TaxCode.SetValue("ab"); //Set field value for UnitOfMeasure SalesOrderItemMod3297.UnitOfMeasure.SetValue("ab"); //Set field value for UPC SalesOrderItemMod3297.UPC.SetValue("ab"); //Set field value for IncludeRetElementList //May create more than one of these if needed SalesOrderModRq.IncludeRetElementList.Add("ab"); } void WalkSalesOrderModRs(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.rtSalesOrderModRs) { //upcast to more specific type here, this is safe because we checked with response.Type check above ISalesOrderRet SalesOrderRet = (ISalesOrderRet)response.Detail; WalkSalesOrderRet(SalesOrderRet); } } } } } void WalkSalesOrderRet(ISalesOrderRet SalesOrderRet) { if (SalesOrderRet == null) return; //Go through all the elements of ISalesOrderRet //Get value of TxnID if (SalesOrderRet.TxnID != null) { string TxnID3298 = (string)SalesOrderRet.TxnID.GetValue(); } //Get value of TimeCreated if (SalesOrderRet.TimeCreated != null) { DateTime TimeCreated3299 = (DateTime)SalesOrderRet.TimeCreated.GetValue(); } //Get value of TimeModified if (SalesOrderRet.TimeModified != null) { DateTime TimeModified3300 = (DateTime)SalesOrderRet.TimeModified.GetValue(); } //Get value of Associate if (SalesOrderRet.Associate != null) { string Associate3301 = (string)SalesOrderRet.Associate.GetValue(); } //Get value of BalanceDue if (SalesOrderRet.BalanceDue != null) { double BalanceDue3302 = (double)SalesOrderRet.BalanceDue.GetValue(); } //Get value of Cashier if (SalesOrderRet.Cashier != null) { string Cashier3303 = (string)SalesOrderRet.Cashier.GetValue(); } //Get value of CustomerListID if (SalesOrderRet.CustomerListID != null) { string CustomerListID3304 = (string)SalesOrderRet.CustomerListID.GetValue(); } //Get value of DepositBalance if (SalesOrderRet.DepositBalance != null) { double DepositBalance3305 = (double)SalesOrderRet.DepositBalance.GetValue(); } //Get value of Discount if (SalesOrderRet.Discount != null) { double Discount3306 = (double)SalesOrderRet.Discount.GetValue(); } //Get value of DiscountPercent if (SalesOrderRet.DiscountPercent != null) { float DiscountPercent3307 = (float)SalesOrderRet.DiscountPercent.GetValue(); } //Get value of Instructions if (SalesOrderRet.Instructions != null) { string Instructions3308 = (string)SalesOrderRet.Instructions.GetValue(); } //Get value of ItemsCount if (SalesOrderRet.ItemsCount != null) { int ItemsCount3309 = (int)SalesOrderRet.ItemsCount.GetValue(); } //Get value of PriceLevelNumber if (SalesOrderRet.PriceLevelNumber != null) { ENPriceLevelNumber PriceLevelNumber3310 = (ENPriceLevelNumber)SalesOrderRet.PriceLevelNumber.GetValue(); } //Get value of PromoCode if (SalesOrderRet.PromoCode != null) { string PromoCode3311 = (string)SalesOrderRet.PromoCode.GetValue(); } //Get value of Qty if (SalesOrderRet.Qty != null) { int Qty3312 = (int)SalesOrderRet.Qty.GetValue(); } //Get value of SalesOrderNumber if (SalesOrderRet.SalesOrderNumber != null) { string SalesOrderNumber3313 = (string)SalesOrderRet.SalesOrderNumber.GetValue(); } //Get value of SalesOrderStatusDesc if (SalesOrderRet.SalesOrderStatusDesc != null) { string SalesOrderStatusDesc3314 = (string)SalesOrderRet.SalesOrderStatusDesc.GetValue(); } //Get value of SalesOrderType if (SalesOrderRet.SalesOrderType != null) { ENSalesOrderType SalesOrderType3315 = (ENSalesOrderType)SalesOrderRet.SalesOrderType.GetValue(); } //Get value of StoreExchangeStatus if (SalesOrderRet.StoreExchangeStatus != null) { ENStoreExchangeStatus StoreExchangeStatus3316 = (ENStoreExchangeStatus)SalesOrderRet.StoreExchangeStatus.GetValue(); } //Get value of Subtotal if (SalesOrderRet.Subtotal != null) { double Subtotal3317 = (double)SalesOrderRet.Subtotal.GetValue(); } //Get value of TaxAmount if (SalesOrderRet.TaxAmount != null) { double TaxAmount3318 = (double)SalesOrderRet.TaxAmount.GetValue(); } //Get value of TaxCategory if (SalesOrderRet.TaxCategory != null) { string TaxCategory3319 = (string)SalesOrderRet.TaxCategory.GetValue(); } //Get value of TaxPercentage if (SalesOrderRet.TaxPercentage != null) { float TaxPercentage3320 = (float)SalesOrderRet.TaxPercentage.GetValue(); } //Get value of Total if (SalesOrderRet.Total != null) { double Total3321 = (double)SalesOrderRet.Total.GetValue(); } //Get value of TxnDate if (SalesOrderRet.TxnDate != null) { DateTime TxnDate3322 = (DateTime)SalesOrderRet.TxnDate.GetValue(); } //Get value of UnfilledPercent if (SalesOrderRet.UnfilledPercent != null) { float UnfilledPercent3323 = (float)SalesOrderRet.UnfilledPercent.GetValue(); } if (SalesOrderRet.BillingInformation != null) { //Get value of City if (SalesOrderRet.BillingInformation.City != null) { string City3324 = (string)SalesOrderRet.BillingInformation.City.GetValue(); } //Get value of CompanyName if (SalesOrderRet.BillingInformation.CompanyName != null) { string CompanyName3325 = (string)SalesOrderRet.BillingInformation.CompanyName.GetValue(); } //Get value of Country if (SalesOrderRet.BillingInformation.Country != null) { string Country3326 = (string)SalesOrderRet.BillingInformation.Country.GetValue(); } //Get value of FirstName if (SalesOrderRet.BillingInformation.FirstName != null) { string FirstName3327 = (string)SalesOrderRet.BillingInformation.FirstName.GetValue(); } //Get value of LastName if (SalesOrderRet.BillingInformation.LastName != null) { string LastName3328 = (string)SalesOrderRet.BillingInformation.LastName.GetValue(); } //Get value of Phone if (SalesOrderRet.BillingInformation.Phone != null) { string Phone3329 = (string)SalesOrderRet.BillingInformation.Phone.GetValue(); } //Get value of Phone2 if (SalesOrderRet.BillingInformation.Phone2 != null) { string Phone23330 = (string)SalesOrderRet.BillingInformation.Phone2.GetValue(); } //Get value of Phone3 if (SalesOrderRet.BillingInformation.Phone3 != null) { string Phone33331 = (string)SalesOrderRet.BillingInformation.Phone3.GetValue(); } //Get value of Phone4 if (SalesOrderRet.BillingInformation.Phone4 != null) { string Phone43332 = (string)SalesOrderRet.BillingInformation.Phone4.GetValue(); } //Get value of PostalCode if (SalesOrderRet.BillingInformation.PostalCode != null) { string PostalCode3333 = (string)SalesOrderRet.BillingInformation.PostalCode.GetValue(); } //Get value of Salutation if (SalesOrderRet.BillingInformation.Salutation != null) { string Salutation3334 = (string)SalesOrderRet.BillingInformation.Salutation.GetValue(); } //Get value of State if (SalesOrderRet.BillingInformation.State != null) { string State3335 = (string)SalesOrderRet.BillingInformation.State.GetValue(); } //Get value of Street if (SalesOrderRet.BillingInformation.Street != null) { string Street3336 = (string)SalesOrderRet.BillingInformation.Street.GetValue(); } //Get value of Street2 if (SalesOrderRet.BillingInformation.Street2 != null) { string Street23337 = (string)SalesOrderRet.BillingInformation.Street2.GetValue(); } //Get value of WebNumber if (SalesOrderRet.BillingInformation.WebNumber != null) { string WebNumber3338 = (string)SalesOrderRet.BillingInformation.WebNumber.GetValue(); } } if (SalesOrderRet.ShippingInformation != null) { //Get value of AddressName if (SalesOrderRet.ShippingInformation.AddressName != null) { string AddressName3339 = (string)SalesOrderRet.ShippingInformation.AddressName.GetValue(); } //Get value of City if (SalesOrderRet.ShippingInformation.City != null) { string City3340 = (string)SalesOrderRet.ShippingInformation.City.GetValue(); } //Get value of CompanyName if (SalesOrderRet.ShippingInformation.CompanyName != null) { string CompanyName3341 = (string)SalesOrderRet.ShippingInformation.CompanyName.GetValue(); } //Get value of Country if (SalesOrderRet.ShippingInformation.Country != null) { string Country3342 = (string)SalesOrderRet.ShippingInformation.Country.GetValue(); } //Get value of FullName if (SalesOrderRet.ShippingInformation.FullName != null) { string FullName3343 = (string)SalesOrderRet.ShippingInformation.FullName.GetValue(); } //Get value of Phone if (SalesOrderRet.ShippingInformation.Phone != null) { string Phone3344 = (string)SalesOrderRet.ShippingInformation.Phone.GetValue(); } //Get value of Phone2 if (SalesOrderRet.ShippingInformation.Phone2 != null) { string Phone23345 = (string)SalesOrderRet.ShippingInformation.Phone2.GetValue(); } //Get value of Phone3 if (SalesOrderRet.ShippingInformation.Phone3 != null) { string Phone33346 = (string)SalesOrderRet.ShippingInformation.Phone3.GetValue(); } //Get value of Phone4 if (SalesOrderRet.ShippingInformation.Phone4 != null) { string Phone43347 = (string)SalesOrderRet.ShippingInformation.Phone4.GetValue(); } //Get value of PostalCode if (SalesOrderRet.ShippingInformation.PostalCode != null) { string PostalCode3348 = (string)SalesOrderRet.ShippingInformation.PostalCode.GetValue(); } //Get value of ShipBy if (SalesOrderRet.ShippingInformation.ShipBy != null) { string ShipBy3349 = (string)SalesOrderRet.ShippingInformation.ShipBy.GetValue(); } //Get value of Shipping if (SalesOrderRet.ShippingInformation.Shipping != null) { double Shipping3350 = (double)SalesOrderRet.ShippingInformation.Shipping.GetValue(); } //Get value of State if (SalesOrderRet.ShippingInformation.State != null) { string State3351 = (string)SalesOrderRet.ShippingInformation.State.GetValue(); } //Get value of Street if (SalesOrderRet.ShippingInformation.Street != null) { string Street3352 = (string)SalesOrderRet.ShippingInformation.Street.GetValue(); } //Get value of Street2 if (SalesOrderRet.ShippingInformation.Street2 != null) { string Street23353 = (string)SalesOrderRet.ShippingInformation.Street2.GetValue(); } } if (SalesOrderRet.SalesOrderItemRetList != null) { for (int i3354 = 0; i3354 < SalesOrderRet.SalesOrderItemRetList.Count; i3354++) { ISalesOrderItemRet SalesOrderItemRet = SalesOrderRet.SalesOrderItemRetList.GetAt(i3354); //Get value of ListID if (SalesOrderItemRet.ListID != null) { string ListID3355 = (string)SalesOrderItemRet.ListID.GetValue(); } //Get value of TxnLineID if (SalesOrderItemRet.TxnLineID != null) { int TxnLineID3356 = (int)SalesOrderItemRet.TxnLineID.GetValue(); } //Get value of ALU if (SalesOrderItemRet.ALU != null) { string ALU3357 = (string)SalesOrderItemRet.ALU.GetValue(); } //Get value of Associate if (SalesOrderItemRet.Associate != null) { string Associate3358 = (string)SalesOrderItemRet.Associate.GetValue(); } //Get value of Attribute if (SalesOrderItemRet.Attribute != null) { string Attribute3359 = (string)SalesOrderItemRet.Attribute.GetValue(); } //Get value of Commission if (SalesOrderItemRet.Commission != null) { double Commission3360 = (double)SalesOrderItemRet.Commission.GetValue(); } //Get value of Desc1 if (SalesOrderItemRet.Desc1 != null) { string Desc13361 = (string)SalesOrderItemRet.Desc1.GetValue(); } //Get value of Desc2 if (SalesOrderItemRet.Desc2 != null) { string Desc23362 = (string)SalesOrderItemRet.Desc2.GetValue(); } //Get value of Discount if (SalesOrderItemRet.Discount != null) { double Discount3363 = (double)SalesOrderItemRet.Discount.GetValue(); } //Get value of DiscountPercent if (SalesOrderItemRet.DiscountPercent != null) { float DiscountPercent3364 = (float)SalesOrderItemRet.DiscountPercent.GetValue(); } //Get value of DiscountType if (SalesOrderItemRet.DiscountType != null) { string DiscountType3365 = (string)SalesOrderItemRet.DiscountType.GetValue(); } //Get value of DiscountSource if (SalesOrderItemRet.DiscountSource != null) { ENDiscountSource DiscountSource3366 = (ENDiscountSource)SalesOrderItemRet.DiscountSource.GetValue(); } //Get value of ExtendedPrice if (SalesOrderItemRet.ExtendedPrice != null) { double ExtendedPrice3367 = (double)SalesOrderItemRet.ExtendedPrice.GetValue(); } //Get value of ExtendedTax if (SalesOrderItemRet.ExtendedTax != null) { double ExtendedTax3368 = (double)SalesOrderItemRet.ExtendedTax.GetValue(); } //Get value of ItemNumber if (SalesOrderItemRet.ItemNumber != null) { int ItemNumber3369 = (int)SalesOrderItemRet.ItemNumber.GetValue(); } //Get value of NumberOfBaseUnits if (SalesOrderItemRet.NumberOfBaseUnits != null) { int NumberOfBaseUnits3370 = (int)SalesOrderItemRet.NumberOfBaseUnits.GetValue(); } //Get value of Price if (SalesOrderItemRet.Price != null) { double Price3371 = (double)SalesOrderItemRet.Price.GetValue(); } //Get value of PriceLevelNumber if (SalesOrderItemRet.PriceLevelNumber != null) { ENPriceLevelNumber PriceLevelNumber3372 = (ENPriceLevelNumber)SalesOrderItemRet.PriceLevelNumber.GetValue(); } //Get value of Qty if (SalesOrderItemRet.Qty != null) { int Qty3373 = (int)SalesOrderItemRet.Qty.GetValue(); } //Get value of QtySold if (SalesOrderItemRet.QtySold != null) { int QtySold3374 = (int)SalesOrderItemRet.QtySold.GetValue(); } //Get value of SerialNumber if (SalesOrderItemRet.SerialNumber != null) { string SerialNumber3375 = (string)SalesOrderItemRet.SerialNumber.GetValue(); } //Get value of Size if (SalesOrderItemRet.Size != null) { string Size3376 = (string)SalesOrderItemRet.Size.GetValue(); } //Get value of TaxAmount if (SalesOrderItemRet.TaxAmount != null) { double TaxAmount3377 = (double)SalesOrderItemRet.TaxAmount.GetValue(); } //Get value of TaxCode if (SalesOrderItemRet.TaxCode != null) { string TaxCode3378 = (string)SalesOrderItemRet.TaxCode.GetValue(); } //Get value of TaxPercentage if (SalesOrderItemRet.TaxPercentage != null) { float TaxPercentage3379 = (float)SalesOrderItemRet.TaxPercentage.GetValue(); } //Get value of UnitOfMeasure if (SalesOrderItemRet.UnitOfMeasure != null) { string UnitOfMeasure3380 = (string)SalesOrderItemRet.UnitOfMeasure.GetValue(); } //Get value of UPC if (SalesOrderItemRet.UPC != null) { string UPC3381 = (string)SalesOrderItemRet.UPC.GetValue(); } //Get value of WebDesc if (SalesOrderItemRet.WebDesc != null) { string WebDesc3382 = (string)SalesOrderItemRet.WebDesc.GetValue(); } //Get value of Manufacturer if (SalesOrderItemRet.Manufacturer != null) { string Manufacturer3383 = (string)SalesOrderItemRet.Manufacturer.GetValue(); } //Get value of Weight if (SalesOrderItemRet.Weight != null) { float Weight3384 = (float)SalesOrderItemRet.Weight.GetValue(); } //Get value of WebSKU if (SalesOrderItemRet.WebSKU != null) { string WebSKU3385 = (string)SalesOrderItemRet.WebSKU.GetValue(); } } } if (SalesOrderRet.DataExtRetList != null) { for (int i3386 = 0; i3386 < SalesOrderRet.DataExtRetList.Count; i3386++) { IDataExtRet DataExtRet = SalesOrderRet.DataExtRetList.GetAt(i3386); //Get value of OwnerID string OwnerID3387 = (string)DataExtRet.OwnerID.GetValue(); //Get value of DataExtName string DataExtName3388 = (string)DataExtRet.DataExtName.GetValue(); //Get value of DataExtType ENDataExtType DataExtType3389 = (ENDataExtType)DataExtRet.DataExtType.GetValue(); //Get value of DataExtValue string DataExtValue3390 = (string)DataExtRet.DataExtValue.GetValue(); } } } } } |