Share via


PromoCode Property

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Gets or sets the code that the current discount is associated with (if applicable).

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

Syntax

'Declaration
Public Property PromoCode As String
'Usage
Dim instance As DiscountApplicationRecordBase
Dim value As String

value = instance.PromoCode

instance.PromoCode = value
public string PromoCode { get; set; }
public:
property String^ PromoCode {
    String^ get ();
    void set (String^ value);
}
public function get PromoCode () : String
public function set PromoCode (value : String)

Property Value

Type: System..::.String
The code that the current discount is associated with (if applicable).

Exceptions

Exception Condition
ArgumentException

The length of the string being set is greater than the maximum allowable length specified in the orders storage mapping file.

Remarks

The PromoCode is a string that the customer types into a page on the site to redeem a PromoCode enabled discount. For discounts not associated with a PromoCode this property will be nullNothingnullptra null reference (Nothing in Visual Basic).

The string value provided is trimmed of leading and trailing white space characters prior to being set.

The default maximum length for this property is 64 characters, as defined in the corresponding table column constraint specified in the default orders storage mapping file, OrderObjectMappings.xml.

Permissions

See Also

Reference

DiscountApplicationRecordBase Class

DiscountApplicationRecordBase Members

Microsoft.CommerceServer.Runtime.Orders Namespace