Share via


Save Method

Saves changes made to the current DirectMail object.

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

Syntax

'Declaration
Public Overrides Sub Save ( _
    forceOverwrite As Boolean _
)
'Usage
Dim instance As DirectMail
Dim forceOverwrite As Boolean

instance.Save(forceOverwrite)
public override void Save(
    bool forceOverwrite
)
public:
virtual void Save(
    bool forceOverwrite
) override
public override function Save(
    forceOverwrite : boolean
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

The xml serializable CampaignItemData received at the web service was nullNothingnullptra null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

The Id of the CampaignItem is less than zero.

NotAuthorizedException

The user is not authorized to perform the requested updates.

EntityDoesNotExistException

The Campaign specified by CampaignName does not exist.

EntityStateException

The update cannot be performed because the Campaign specified by CampaignName has been deleted.

EntityDoesNotExistException

The ItemType is not a recognized CampaignItemType.

DuplicateEntityNameException

A campaign item with the specified Name already exists with in the context of the Campaign specified by CampaignName.

EntityDoesNotExistException

A Mailing List associated with this Direct Mail does not exist.

StringLengthValidationException

A string property of the Direct Mail is too long or cannot be set to empty string. See individual properties for details.

ArgumentNullException

A string property of the Direct Mail cannot be set to nullNothingnullptra null reference (Nothing in Visual Basic). See individual properties for details.

EnumeratedValueValidationException

An enumeration value of the Direct Mail is not valid.

MaximumValueValidationException

One or more of the numeric property values of the Direct Mail was set to a value greater than the maximum allowed.

MinimumValueValidationException

One or more of the numeric property values of the Direct Mail was set to a value less than the minimum allowed.

OptimisticLockException

LastModifiedDate of the object was not set or the record was modified in the database since being loaded for editing. This exception is raised only if forceOverwrite is set to false.

EntityStateException

The Direct Mail is currently active and cannot be modified. The Active flag must be set to false before any modifications can be made.

EntityStateException

The Direct Mail cannot be modified because it has been deleted.

InvalidOperationException

An attempt was made to modify the CampaignName of an existing Direct Mail. This operation must be performed through MoveCampaignItemToCampaign.

InvalidOperationException

An attempt was made to update the Active status of an existing Direct Mail through the Save API. To update this status, please use Activate or Deactivate.

Remarks

Saves the changes made to this DirectMail object.

Save can be used to add a new DirectMail to the database or update an existing DirectMail in the database.

Controls optimistic locking behavior. If the forceOverwrite parameter 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

DirectMail Class

DirectMail Members

Microsoft.CommerceServer.Marketing Namespace