Partager via


Delete Method

Deletes a PromoCodeDefinition object.

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

Syntax

'Declaration
Public Sub Delete ( _
    promoCodeDefinitionId As Integer _
)
'Usage
Dim instance As PromoCodeDefinitionManager
Dim promoCodeDefinitionId As Integer

instance.Delete(promoCodeDefinitionId)
public void Delete(
    int promoCodeDefinitionId
)
public:
void Delete(
    int promoCodeDefinitionId
)
public function Delete(
    promoCodeDefinitionId : int
)

Parameters

Exceptions

Exception Condition
ArgumentOutOfRangeException

The promoCodeDefinitionId argument value was less than one.

EntityDoesNotExistException

The requested PromoCodeDefinition object does not exist.

EntityReferencedException

One or more discount campaign items are associated with this PromoCodeDefinition object. The definition must be disassociated from the campaign item(s) before it can be deleted. Note that the discount campaign item(s) may already be in the deleted (archived) state.

NotAuthorizedException

The user is not authorized to perform this operation.

Remarks

PromoCodeDefinition objects do not support a Restore method. Deletion is final and results in the deletion of all related history and transaction information.

This method uses the long running SQL command, sqlCommandTimeoutSeconds, of MarketingServices. The long running SQL command time out default is specified in web.config and is normally 120 seconds.

Permissions

See Also

Reference

PromoCodeDefinitionManager Class

PromoCodeDefinitionManager Members

Microsoft.CommerceServer.Marketing Namespace