Share via


OrderForm.AddItem Method (PIA)

Use this method to add the specified item to the items collection of an OrderForm object. The items collection is a SimpleList object containing Dictionary objects.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Orders
…
Public Function AddItem(varSKU As Object,
  lCount As Integer,
  lPlacedPrice As Integer) As Object

[C#]

using Microsoft.CommerceServer.Interop.Orders;
…
object AddItem(objectvarSKU,
  intlCount,
  intlPlacedPrice);

Parameters

[Visual Basic .NET]

  • varSKU
    An Object that contains the SKU of the item to add.
  • lCount
    An Integer that contains the item count.
  • lPlacedPrice
    An Integer that is reserved for future use. This parameter must be set to 0 (zero).

[C#]

  • varSKU
    A VARIANT that contains the stockkeeping unit (SKU) of the item to add.
  • lCount
    An int that contains the item count.
  • lPlacedPrice
    An int that contains the placed price of the item.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns an Object reference that holds the Dictionary object that contains the added item.

[C#] This method returns an object indicating whether or not it completed successfully. A Dictionary object is used to return the added item; if the method does not complete successfully, the object will be null.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

Remarks

The returned object parameter contains valid data only if the method returns successfully; otherwise, it is null.

[Visual Basic .NET]

Example

' Order is a Commerce.OrderForm object; a quantity of 5 is 
' being added of the product whose SKU is SKUnumber.
Order.AddItem("SKUnumber", 5,0)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Orders

Platforms: Windows 2000, Windows Server 2003

Assembly: MSCSCoreLib (in MSCSCoreLib.dll)

See Also

OrderForm Class

OrderForm.ClearItems

OrderForm.ClearOrderForm

Copyright © 2005 Microsoft Corporation.
All rights reserved.