Share via


SavePurchaseOrder Method

Save a new PurchaseOrder objects. If a PurchaseOrder with the specified OrderGroup identifier is already present in the Database an update operation is performed.

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

Syntax

'Declaration
Public Function SavePurchaseOrder ( _
    purchaseOrderXml As XmlElement, _
    applicationId As String _
) As Guid
'Usage
Dim instance As PurchaseOrderManager
Dim purchaseOrderXml As XmlElement
Dim applicationId As String
Dim returnValue As Guid

returnValue = instance.SavePurchaseOrder(purchaseOrderXml, _
    applicationId)
public Guid SavePurchaseOrder(
    XmlElement purchaseOrderXml,
    string applicationId
)
public:
Guid SavePurchaseOrder(
    XmlElement^ purchaseOrderXml, 
    String^ applicationId
)
public function SavePurchaseOrder(
    purchaseOrderXml : XmlElement, 
    applicationId : String
) : Guid

Parameters

  • applicationId
    Type: System..::.String
    Identifier for the caller application as defined in the StatusManager table in transactionconfig database.

Return Value

Type: System..::.Guid
The order group identifier for the purchase order being saved.

Exceptions

Exception Condition
OrderNotSavedException

A PurchaseOrder is not persisted to the Storage,

UnsupportedTypeException

A strongly typed property or a weakly typed property with an unsupported type is found,

NotAuthorizedException

User does not have permission to perform this operation.

TimeoutException

Thrown if an SQL command timeout occurs.

Remarks

Updates an existing PurchaseOrder or saves a new PurchaseOrder. Xml which conforms to the orders XSD is de-serialized into a Purchase Order and the PurchaseOrder will be saved. Method performs the concurrency check for the existing purchase orders.

The XML which conforms to the orders XSD is de-serialized into a Purchase Order and the purchase order is saved. This method performs the concurrency check for the existing purchase orders.

In order to perform a SavePurchaseOrders, the user must have the OrdersAdapter permissions. See Orders System Roles [CS06] for more information about the specific roles in the Order System.

Some order system APIs support distributed transactions. If a cookie with a valid transaction is found the order system enlists as part of that transaction. If a valid transaction is not found the order system initiates a new transaction.

Permissions

See Also

Reference

PurchaseOrderManager Class

PurchaseOrderManager Members

Microsoft.CommerceServer.Orders Namespace