OrderGroup.SaveAsBasket Method (PIA)

Use this method to save the OrderGroup object to the database with a basket status.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Orders
…
Public Function SaveAsBasket() As Object

[C#]

using Microsoft.CommerceServer.Interop.Orders;
…
public object SaveAsBasket();

Return Values

[Visual Basic .NET] If this method completes successfully, it returns an Object that specifies the OrderGroupID.

[C#] This method returns an object containing the OrderGroupID.

Exceptions

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

Remarks

This method sets the OrderGroup object status to "basket", and sets the OrderGroupID equal to the user ID.

If the OrderGroup object was not loaded from a basket, this method deletes any existing on-disk basket before inserting the order group into the data storage.

If the OrderGroup object was loaded from a basket, this method performs an update or insert depending on whether the OrderGroup was found on disk on the load call. If you load a template or order and call the SaveAsBasket method, the template or order that was originally loaded remains unchanged on disk.

When the OrderGroup.SaveAsOrder, SaveAsBasket, or SaveAsTemplate methods are called, four values are copied from the first OrderForm in the OrderGroup into the OrderGroup object itself. If any of these values already existed at the OrderGroup level, they are overwritten with the values copied from the OrderForm. If the value was Null or never set on the OrderForm, and the value was set on the OrderGroup, the OrderGroup value is overwritten with Null. The values replaced in the OrderGroup are user_first_name, user_last_name, billing_currency, and user_org_name.

[Visual Basic .NET]

Example

' oOrderGroup is a Commerce.OrderGroup object
' oResult is an Object
oResult = oOrderGroup.SaveAsBasket()

Requirements

Namespace: Microsoft.CommerceServer.Interop.Orders

Platforms: Windows 2000, Windows Server 2003

Assembly: Microsoft.CommerceServer.Interop.Orders.Requisition.dll

See Also

OrderGroup Class

OrderGroup.LoadBasket

OrderGroup.SaveAsOrder

OrderGroup.SaveAsTemplate

Copyright © 2005 Microsoft Corporation.
All rights reserved.