Delen via


NewDiscount Method

Creates a new Discount using the default values.

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

Syntax

'Declaration
Public Function NewDiscount ( _
    parentCampaignId As Integer _
) As Discount
'Usage
Dim instance As CampaignItemManager
Dim parentCampaignId As Integer
Dim returnValue As Discount

returnValue = instance.NewDiscount(parentCampaignId)
public Discount NewDiscount(
    int parentCampaignId
)
public:
Discount^ NewDiscount(
    int parentCampaignId
)
public function NewDiscount(
    parentCampaignId : int
) : Discount

Parameters

Return Value

Type: Microsoft.CommerceServer.Marketing..::.Discount
The newly created Discount object.

Exceptions

Exception Condition
ArgumentOutOfRangeException

The parentCampaignId value was less than one.

EntityDoesNotExistException

The Campaign specified by parentCampaignId does not exist.

EntityStateException

The Campaign specified by parentCampaignId is deleted.

Remarks

Returns the newly created Discount with default values. The Discount is not persisted in the database until its Save method is called.

Permissions

See Also

Reference

CampaignItemManager Class

CampaignItemManager Members

Microsoft.CommerceServer.Marketing Namespace