Share via


GetOrderTemplate Method (Guid, Guid)

Returns an existing OrderTemplate using the specified customer identifier and order template identifier, or creates a new one if none currently exist.

Namespace:  Microsoft.CommerceServer.Runtime.Orders
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Function GetOrderTemplate ( _
    userId As Guid, _
    orderGroupId As Guid _
) As OrderTemplate
'Usage
Dim instance As OrderContext
Dim userId As Guid
Dim orderGroupId As Guid
Dim returnValue As OrderTemplate

returnValue = instance.GetOrderTemplate(userId, _
    orderGroupId)
public OrderTemplate GetOrderTemplate(
    Guid userId,
    Guid orderGroupId
)
public:
OrderTemplate^ GetOrderTemplate(
    Guid userId, 
    Guid orderGroupId
)
public function GetOrderTemplate(
    userId : Guid, 
    orderGroupId : Guid
) : OrderTemplate

Parameters

  • userId
    Type: System..::.Guid
    The identifier of the customer owning the order template.
  • orderGroupId
    Type: System..::.Guid
    The template identifier of the order template. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).

Return Value

Type: Microsoft.CommerceServer.Runtime.Orders..::.OrderTemplate
An instance of the OrderTemplate instance, or a new empty order template instance, if one is not found.

Exceptions

Exception Condition
ArgumentException

userId or orderGroupId is empty.

Remarks

Use this method to retrieve a OrderTemplate meeting the specified criteria, the identifier of the customer and the identifier of the order template. If no OrderTemplate currently exists, one is created.

Permissions

See Also

Reference

OrderContext Class

OrderContext Members

GetOrderTemplate Overload

Microsoft.CommerceServer.Runtime.Orders Namespace