PrioritizeDiscount Method

Used to prioritize a single discount.

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

Syntax

'Declaration
Public Sub PrioritizeDiscount ( _
    campaignItemId As Integer, _
    newPriority As Integer, _
    prioritizeOption As PrioritizeOption _
)
'Usage
Dim instance As CampaignItemManager
Dim campaignItemId As Integer
Dim newPriority As Integer
Dim prioritizeOption As PrioritizeOption

instance.PrioritizeDiscount(campaignItemId, _
    newPriority, prioritizeOption)
public void PrioritizeDiscount(
    int campaignItemId,
    int newPriority,
    PrioritizeOption prioritizeOption
)
public:
void PrioritizeDiscount(
    int campaignItemId, 
    int newPriority, 
    PrioritizeOption prioritizeOption
)
public function PrioritizeDiscount(
    campaignItemId : int, 
    newPriority : int, 
    prioritizeOption : PrioritizeOption
)

Parameters

  • campaignItemId
    Type: System..::.Int32
    The campaign item Id of the discount to prioritize.
  • newPriority
    Type: System..::.Int32
    The new priority value. This must be within one of the greatest existing priority in the database or the call will fail.
  • prioritizeOption
    Type: Microsoft.CommerceServer.Marketing..::.PrioritizeOption
    Determines whether the newPriority should form a group with other discounts of the same priority (if any exist at that priority level), or if the priorities should be shifted so that this item is alone in its new priority level.

Exceptions

Exception Condition
ArgumentOutOfRangeException

The campaign item Id is less than or equal to zero.

ArgumentException

The priority value provided is less than or equal to zero. Or the priority value provided is greater than the highest priority level in the system.

DiscountPrioritizationException

The newPriority is greater than the maximum priority allowed.

EntityDoesNotExistException

The requested CampaignItem record does not exist.

EntityStateException

An attempt was made to update an active discount.

DatabaseIntegrityException

A discount record with the specified Id does not exist, but the CampaignItem record itself exists. This indicates a data integrity problem.

Remarks

The discount priority determines when the discount should be applied to a product relative to other discounts that apply to a product.

The PrioritizeOption enumeration shall be:

  • GroupWithSamePriority - The existing discount priorities should remain unchanged,

  • InsertRelative - The existing discount priorities should be shifted up (increasing their priority level).

Permissions

See Also

Reference

CampaignItemManager Class

CampaignItemManager Members

Microsoft.CommerceServer.Marketing Namespace