Share via


SaveCampaign Method

Insert a new Campaign (if the identifier is zero), or updates an existing Campaign (if the identifier is not zero).

Namespace:  Microsoft.CommerceServer.Marketing.WebService
Assembly:  Microsoft.CommerceServer.Marketing.DataManagement (in Microsoft.CommerceServer.Marketing.DataManagement.dll)

Syntax

'Declaration
<WebMethodAttribute> _
Public Overridable Function SaveCampaign ( _
    campaign As CampaignData, _
    forceOverwrite As Boolean _
) As CampaignData
'Usage
Dim instance As MarketingWebService
Dim campaign As CampaignData
Dim forceOverwrite As Boolean
Dim returnValue As CampaignData

returnValue = instance.SaveCampaign(campaign, _
    forceOverwrite)
[WebMethodAttribute]
public virtual CampaignData SaveCampaign(
    CampaignData campaign,
    bool forceOverwrite
)
[WebMethodAttribute]
public:
virtual CampaignData^ SaveCampaign(
    CampaignData^ campaign, 
    bool forceOverwrite
)
public function SaveCampaign(
    campaign : CampaignData, 
    forceOverwrite : boolean
) : CampaignData

Parameters

  • campaign
    Type: CampaignData
    The campaign data to be saved (set to zero for an insert).
  • forceOverwrite
    Type: System..::.Boolean
    true to indicate that existing settings should be overwritten even if they are more recent; otherwise false.

Return Value

Type: CampaignData
A CampaignData with the specified Campaign.

Exceptions

Exception Condition
ArgumentOutOfRangeException

campaign is less than zero.

NotAuthorizedException

The user is not authorized to perform the requested operation.

ArgumentNullException

An input argument or one of the required properties is nullNothingnullptra null reference (Nothing in Visual Basic).

StringLengthValidationException

One if the property values is too long or too short.

DuplicateEntityNameException

An entity with this name already exists.

DuplicateEntityIdException

An entity with this campaign already exists.

EntityDoesNotExistException

No campaign exists with this campaign, or one of the entities that this one depends on does not exist

DateRangeValidationException

Start and/or End Dates are invalid.

DatabaseIntegrityException

A serious integrity issue with the database exists.

Remarks

Saves the specified Campaign object to the database. Inserts a new Campaign (if the identifier is zero), or updates an existing Campaign (if the identifier is not zero).

Use forceOverwrite to prevent overwriting the object in the database.

The forceOverwrite controls optimistic locking behavior. If the value is false and the record was modified in the database after it was loaded for editing, then an exception is raised.

Permissions

See Also

Reference

MarketingWebService Class

MarketingWebService Members

Microsoft.CommerceServer.Marketing.WebService Namespace