Skip to content

Save

Saves the changes to the document and returns the current document instance.

1
myDocument.Save():Document

Returns

The current Document instance.

Remarks

Persists the current state without changing it or adding folder associations. A new document stays Draft after Save and does not appear in published folder lists. Use Publish with a folder path to create a visible published entry.

Use Save for draft persistence or updates to editable metadata on an existing version. The standard document UI Save command uses a different path that publishes the document.

Examples

Publish a document and update its metadata later

1
2
3
4
5
6
7
8
9
var doc = $Documents.New('Monthly Report');
doc.Files.AddPDF($Xml.Evaluate('ReportHtml'), 'Report.pdf');

// publish to make the document visible in a folder
doc.Publish('Reports');

// metadata of a published version can still be changed
doc.Description = 'Approved by ' + $ActiveUser.Name;
doc.Save();

See Also