OrderGroup.SaveAsTemplate Method (PIA)

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

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Orders
…
Public Function SaveAsTemplate(Optional strTemplateName As Object) As Object

[C#]

using Microsoft.CommerceServer.Interop.Orders;
…
object SaveAsTemplate(objectstrTemplateName);

Parameters

[Visual Basic .NET]

  • strTemplateName
    An Object that specifies the template name.

[C#]

  • strTemplateName
    An object that specifies the template name.

Return Values

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

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

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 updates the OrderGroup object template name field if the strTemplateName parameter is supplied.

If you originally loaded the OrderGroup object from another state (for example, a basket) and call the SaveAsTemplate method, the original OrderGroup remains on disk unchanged.

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
' vResult is an Object
vResult = oOrderGroup.SaveAsTemplate()

Requirements

Namespace: Microsoft.CommerceServer.Interop.Orders

Platforms: Windows 2000, Windows Server 2003

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

See Also

OrderGroup Class

OrderGroup.SaveAsBasket

OrderGroup.SaveAsOrder

Copyright © 2005 Microsoft Corporation.
All rights reserved.