November Happy Hour will be moved to Thursday December 5th.

Enum SaveAction

Type of save to perform on the page data object

Namespace: EPiServer.DataAccess
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
public enum SaveAction
Remarks

This enumeration contains flag values (ForceNewVersion, ForceCurrentVersion) that provide additional information about the save operation. This means that if you need to check if a SaveAction value means Save, Checkin, Publish or Reject you need to clear the flag values first to do the comparison. This can be done using the ActionMask value which is shown in the second example below.

Examples
  The following code example demonstrates the usage of <strong>SaveAction</strong>.
                PageData pd = GetPage(CurrentPage.PageLink).CreateWritableClone();
    pd["PageName"] = "New Page Name";
    SaveAction action;

    if (pd.CheckPublishedStatus(PagePublishedStatus.PublishedIgnoreDates))
    {
        action = SaveAction.Publish;
    }
    else
    {
        action = SaveAction.Save;
    }
    action = action | SaveAction.ForceCurrentVersion;
    Locate.ContentRepository().Save(pd, action, AccessLevel.NoAccess);
  This example shows how you can clear flag values from a SaveAction value to check if it represents a Save, CheckIn, Publish or Reject value. In this case we check if it is <xref href="EPiServer.DataAccess.SaveAction.Save" data-throw-if-not-resolved="false"></xref>.
                bool isSave = (value & SaveAction.ActionMask) == SaveAction.Save;

Fields

Name Description
ActionMask

Mask to clear Force... settings from SaveAction

CheckIn

Save and check in content, creating a new version only if necessary.

DelayedPublish

Save and check in content, creating a new version only if necessary and sets the content as delayed publish.

ForceCurrentVersion

Save and check in a content instance, always updating the current version

ForceNewVersion

Flag that is used to force the creation of a new version.

None

Do not save data.

Publish

Publish content, creating a new version only if necessary.

Reject

Reject a checked-in content.

RequestApproval

NOTE: This is a pre-release saveAction that is UNSTABLE and might not satisfy the compatibility requirements as denoted by its associated normal version. Transition content to AwaitingApproval state

Save

Save content, leaving it in a checked out state.

SkipSetCommonDraft

When creating new versions, skip setting version to common draft

SkipValidation

Does not validate the data against IValidationService

Extension Methods