Skip to content

State

Gets the state of the document.

Allowed Values

  • Draft
  • Published
  • Archived
  • Deleted

Type

( "Draft" | "Published" | "Archived" | "Deleted" )

Declaration

1
readonly ( "Draft" | "Published" | "Archived" | "Deleted" ) myDocument.State

Remarks

This property returns one of the following values:

  • Draft: The document is in draft mode.
  • Published: The document is published and available.
  • Archived: The document has been archived.
  • Deleted: The document has been marked for deletion.

Info

A Published, Deleted, or Archived state makes file content, content type, version number, and creator information read-only. Title, description, profile data, and ACL remain editable; call Save to persist these changes. A metadata update does not create a new version.

Examples

Check the state before changing a document

1
2
3
4
5
var doc = $Documents.Get($Xml.Evaluate('DocumentId'));

if (doc.State !== 'Published') {
    throw new Error('Only published documents can be sent for approval.');
}