Share via


Save Method

Saves the current instance record to the database.

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

Syntax

'Declaration
Public MustOverride Sub Save ( _
    forceOverwrite As Boolean _
)
'Usage
Dim instance As CampaignItem
Dim forceOverwrite As Boolean

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

Parameters

Exceptions

Exception Condition
ArgumentException

One or more properties that describe the campaign item is invalid. Please refer to actual exception message for more details.

ArgumentNullException

The campaign argument in the current instance was null.

ArgumentOutOfRangeException

The StartDate or EndDate of the current instance is set to an invalid date time value.

DatabaseIntegrityException

A database error has occurred when inserting to the creative table.

DuplicateEntityNameException

A campaign item or other entities being saved with the specified name already exists in the database. For more information, see the actual exception message.

EntityDoesNotExistException

During the creation or update of a campaign item, one or more objects referred to by the current instance do not exist. For more information, see the actual exception message.

DuplicateEntityIdException

An entity with the same Id already exists in the persistent storage. For more information, see the actual exception message.

InvalidOperationException

An attempt was made to update the name of the campaign to which this campaign item belongs.

StringLengthValidationException

One or more string property values of the current CampaignItem instance was set to a disallowed value. For more information, see the specific exception.

DateRangeValidationException

One or more DateTime property values of the current CampaignItem instance was set to an disallowed value. For more information, see the specific exception.

PropertyNullValidationException

One or more property values of the current CampaignItem instance was set to null when not allowed. For more information, see the specific exception.

OptimisticLockException

The LastModifiedDate of the current CampaignItem instance was not set or the current instance record was modified in the database since being loaded for editing. This exception will never be raised if forceOverwrite is set to true.

EntityStateException

An attempt was made to create or update a campaign item object to be associated with a deleted Campaign object or an attempt was made to update a deleted campaign item object.

Remarks

Saves changes to the database. Upon completion sets the HasChanges property to false.

Use forceOverwrite to prevent overwriting the object in the database. This will raise an exception if set to false and the record was modified in the database after it was loaded for editing.

Permissions

See Also

Reference

CampaignItem Class

CampaignItem Members

Microsoft.CommerceServer.Marketing Namespace