Skip to content

Unpublish

Changes this version to Draft, saves it, and removes all folder associations from the document family.

1
myDocument.Unpublish():Document

Unpublishes the document from the specified folders and returns the current document instance.

1
myDocument.Unpublish(folderPath: string):Document

Parameters

string folderPath
    The path of the folder(s) to unpublish the document from.

Returns

The current Document instance.

Remarks

This method changes this version to Draft and saves it. Folder associations belong to the family; removing one affects its placement even when other versions remain Published. The version is excluded from published listings in all folders, not only the paths supplied.

If folderPath is specified, the document is removed from the specified folders. The path can be specified as a full path. Non-existing folders are ignored.

Example

1
2
3
4
var existingDocument = $Documents.Get(id);

// Unpublishing the document under Test\Documents folder path:
existingDocument.Unpublish('Test\\Documents');

See Also