Skip to content

Purge

Permanently removes this document version and its attached file records from the repository.

1
myDocument.Purge():Document

Returns

The current Document instance.

Remarks

This operation cannot be undone. Backend user-context deletion requires Delete permission; $Documents uses a trusted tenant context without user ACL checks. It can remove a version in any state. Repeating the call for an already removed version has no effect. Other versions with the same branch ID are preserved.

Examples

Permanently remove a document that was created by mistake

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

if (doc) {
    doc.Purge();
    $Xml.SetValue('DocumentId', '');
}

See Also