Share via


Save Method

Saves changes made to the current Expression object.

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 Expression
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
ArgumentException

One or more properties that describe the Expression is invalid. For more information, see the specific exception.

ArgumentOutOfRangeException

The Id is less than zero. For more information, see the specific exception.

NotAuthorizedException

The user is not authorized to perform the requested updates.

DuplicateEntityNameException

An expression being saved with the specified name already exists in the database. Only local expressions in different campaign item contexts are allowed to have the same name.

DuplicateEntityIdException

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

StringLengthValidationException

One or more string property values of the current instance was set to an disallowed value. 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 was not set or the expression record was modified in the database since being loaded for editing. This exception will not be raised if forceOverwrite is set to true.

EntityDoesNotExistException

The specified category does not exist.

EntityStateException

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

ExpressionValidationException

The expression body is not valid.

InvalidOperationException

An attempt was made to directly access a local expression. A local expression only exists in the context of a campaign item and therefore must be saved and retrieved with the campaign item.

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.

Save can be used to add new Expression objects to the database or update an existing Expression object in the database.

Permissions

See Also

Reference

Expression Class

Expression Members

Microsoft.CommerceServer.Marketing Namespace