Share via


SaveCampaignItem Method

Insert a new CampaignItem (if the identifier is zero), or updates an existing CampaignItem (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 SaveCampaignItem ( _
    campaignItem As CampaignItemData, _
    forceOverwrite As Boolean _
) As CampaignItemData
'Usage
Dim instance As MarketingWebService
Dim campaignItem As CampaignItemData
Dim forceOverwrite As Boolean
Dim returnValue As CampaignItemData

returnValue = instance.SaveCampaignItem(campaignItem, _
    forceOverwrite)
[WebMethodAttribute]
public virtual CampaignItemData SaveCampaignItem(
    CampaignItemData campaignItem,
    bool forceOverwrite
)
[WebMethodAttribute]
public:
virtual CampaignItemData^ SaveCampaignItem(
    CampaignItemData^ campaignItem, 
    bool forceOverwrite
)
public function SaveCampaignItem(
    campaignItem : CampaignItemData, 
    forceOverwrite : boolean
) : CampaignItemData

Parameters

  • campaignItem
    Type: CampaignItemData
    The campaign item 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: CampaignItemData
A CampaignItemData with the specified CampaignItem.

Exceptions

Exception Condition
ArgumentNullException

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

ArgumentOutOfRangeException

The Campaign Item identifier is less than zero.

NotAuthorizedException

The user is not authorized to perform the requested operation.

EntityDoesNotExistException

The campaignItem does not exist (update)

EntityStateException

The campaignItem has been deleted (update).

ParentEntityDeletedException

The Parent Campaign has been deleted.

EntityDoesNotExistException

The Id being updated does not exist.

ParentEntityDoesNotExistException

The Parent Campaign does not exist.

ParentEntityDeletedException

The Parent Campaign has been deleted.

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 Id already exists.

DateRangeValidationException

Start and/or End Dates are invalid.

DatabaseIntegrityException

A serious integrity issue with the database exists.

Remarks

Saves the specified CampaignItem object to the database. Inserts a new CampaignItem (if the identifier is zero), or updates an existing CampaignItem (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