MessageManager.AddMessage

Ee798599.c++_on(en-US,CS.10).gifEe798599.vb_off(en-US,CS.10).gif

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

Definition

Sub AddMessage(bstrName As String,bstrMessage As String,vtLanguage As Variant)

Parameters

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

A Variant 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.

Return Values

None.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

The following table lists the messages that are used by the default implementation of the OPP, showing the message name constant expected by the Order Processing pipeline (OOP) 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 OrderForm.
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 OrderForm 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 OrderForm.
pur_out_of_stock
FlagInventory, LocalInventory
_Purchase_Errors when an item referenced in the OrderForm is out of stock.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

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

See Also

MessageManager Object

MessageManager.DefaultLanguage

MessageManager.GetMessage


All rights reserved.