Jaa


Save Method

Saves the current Campaign object to the database.

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

Syntax

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

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

Parameters

Exceptions

Exception Condition
ArgumentOutOfRangeException

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

DuplicateEntityNameException

A campaign with the same name as the current instance already exists within the scope of the same customer.

DuplicateEntityIdException

A campaign already exists with the Id of the current instance.

EntityDoesNotExistException

During the creation of a new campaign, an attempt was made to update a Campaign that does not exist. For more information, please refer to actual exception message.

ParentEntityDoesNotExistException

During the update of a campaign, the referenced customer does not exist.

ParentEntityDeletedException

During the update of a campaign, the referenced customer has been deleted.

StringLengthValidationException

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

DateRangeValidationException

One or more DateTime property values of the current instance were set to a disallowed value. For example, the start date of a campaign is set for a later date than the end date. For more information, see the specific exception.

PropertyNullValidationException

One or more property values of the current instance was set to nullNothingnullptra null reference (Nothing in Visual Basic) when not allowed. For more information, see the specific exception.

OptimisticLockException

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

EntityStateException

An attempt was made to create or update a Campaign object to be associated with a deleted Customer 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

Campaign Class

Campaign Members

Microsoft.CommerceServer.Marketing Namespace