Share via


BeginExportPromoCodesForDefinition Method (String, Int32, PromoCodeDefinitionManager.ProgressEventHandler, AsyncCallback, Object)

Asynchronously saves all promocodes in a given definition to a file.

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

Syntax

'Declaration
Public Function BeginExportPromoCodesForDefinition ( _
    filePath As String, _
    promoCodeDefinitionId As Integer, _
    eventHandler As PromoCodeDefinitionManager..::.ProgressEventHandler, _
    callback As AsyncCallback, _
    asyncState As Object _
) As IAsyncResult
'Usage
Dim instance As PromoCodeDefinitionManager
Dim filePath As String
Dim promoCodeDefinitionId As Integer
Dim eventHandler As PromoCodeDefinitionManager..::.ProgressEventHandler
Dim callback As AsyncCallback
Dim asyncState As Object
Dim returnValue As IAsyncResult

returnValue = instance.BeginExportPromoCodesForDefinition(filePath, _
    promoCodeDefinitionId, eventHandler, _
    callback, asyncState)
public IAsyncResult BeginExportPromoCodesForDefinition(
    string filePath,
    int promoCodeDefinitionId,
    PromoCodeDefinitionManager..::.ProgressEventHandler eventHandler,
    AsyncCallback callback,
    Object asyncState
)
public:
IAsyncResult^ BeginExportPromoCodesForDefinition(
    String^ filePath, 
    int promoCodeDefinitionId, 
    PromoCodeDefinitionManager..::.ProgressEventHandler^ eventHandler, 
    AsyncCallback^ callback, 
    Object^ asyncState
)
public function BeginExportPromoCodesForDefinition(
    filePath : String, 
    promoCodeDefinitionId : int, 
    eventHandler : PromoCodeDefinitionManager..::.ProgressEventHandler, 
    callback : AsyncCallback, 
    asyncState : Object
) : IAsyncResult

Parameters

  • filePath
    Type: System..::.String
    Full path to the file to which the promotion codes will be exported.
  • callback
    Type: System..::.AsyncCallback
    The delegate to call when the asynchronous invoke is completed. If callback is nullNothingnullptra null reference (Nothing in Visual Basic), the delegate is not called.

Return Value

Type: System..::.IAsyncResult
An IAsyncResult object representing the status of the asynchronous operation.

Exceptions

Exception Condition
NotAuthorizedException

The user is not authorized to perform this operation.

ArgumentOutOfRangeException

The promoCodeDefinitionId argument value is less than or equal to zero.

EntityDoesNotExistException

A PromoCodeDefinition object with such promoCodeDefinitionId does not exist.

Remarks

The proxy class calls the BeginInvoke method to start an asynchronous invocation call to the XML Web service method. The returned IAsyncResult represents the status of an asynchronous operation and is passed to EndExportPromoCodes to obtain the return values from the remote method call.

eventHandler may be nullNothingnullptra null reference (Nothing in Visual Basic) if the caller does not wish to receive progress notifications.

Permissions

See Also

Reference

PromoCodeDefinitionManager Class

PromoCodeDefinitionManager Members

BeginExportPromoCodesForDefinition Overload

Microsoft.CommerceServer.Marketing Namespace

PromoCodeDefinitionManager..::.ProgressEventHandler