MessageManager.AddMessage Method (PIA)

Use this method to add a message to the MessageManager object.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Sub AddMessage(bstrName As String,
 bstrMessage As String,
 vtLanguage As Object)

[C#]

using Microsoft.CommerceServer.Interop;
…
public void AddMessage(stringbstrName,
  stringbstrMessage,
  objectvtLanguage);

Parameters

[Visual Basic .NET]

  • bstrName
    A String that contains the message name constant, which is a string that identifies the message to add. For a list of common messages and their constant names, see the Remarks section.
  • bstrMessage
    A String that contains the text of the message to add.
  • vtLanguage
    An Object that contains the language name with which to associate the message. This value, if specified, must be a language name added through a previous call to the AddLanguage method. If this parameter is not supplied, the language specified in the DefaultLanguage property of the MessageManager object is used.

[C#]

  • bstrName
    A string that contains the message name constant, which is a string that identifies the message to add. For a list of common messages and their constant names, see the Remarks section.
  • bstrMessage
    A string that contains the text of the message to add.
  • vtLanguage
    An object that contains the language name with which to associate the message. This value, if specified, must be a language name added through a previous call to the AddLanguage method. If this parameter is not supplied (Type.Missing), or is null, the language specified in the DefaultLanguage property of the MessageManager object is used.

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 following table lists the messages that are used by the default implementation of the Order Processing pipeline (OPP), showing the message name constant expected by the OPP components that use these messages.

Message name constant Used by OPP component Added to this collection under this condition
pur_badplacedprice RequiredItemAdjustPrice _Basket_Errors when the price of an item does not correspond to the price contained in the order form.
pur_badhandling RequiredHandling _Purchase_Errors when the handling cost for an order cannot be computed.
pur_badpayment RequiredPayment _Purchase_Errors when authentication code (_payment_auth_code) is not set.
pur_badshipping RequiredShipping _Purchase_Errors when the shipping for an order cannot be computed.
pur_badsku RequiredProdInfo _Basket_Errors when a stockkeeping unit (SKU) in the order form references an item that is not contained in the inventory for the site.
pur_badtax RequiredTax _Purchase_Errors when the tax on a purchase cannot be computed.
pur_badverify RequiredTotal _Purchase_Errors when the data stored by the ProcessVerifyWith method does not match the original data in the order form.
pur_noitems RequiredOrderCheck _Purchase_Errors when there are no items in the order form.
pur_out_of_stock FlagInventory, LocalInventory _Purchase_Errors when an item referenced in the order form is out of stock.

[Visual Basic .NET]

Example

' oMessageManager is a Commerce.MessageManager object
oMessageManager.AddMessage("pur_out_of_stock", _
    "At least one item is out of stock.")

Requirements

Namespace: Microsoft.CommerceServer.Interop

Platforms: Windows 2000, Windows Server 2003

Assembly: mscsasphelplib (in mscsasphelplib.dll)

See Also

MessageManager Class

MessageManager.DefaultLanguage

MessageManager.GetMessage

Copyright © 2005 Microsoft Corporation.
All rights reserved.