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.

Creating a new document, publishing it, making some changes, and saving the changes

1
2
3
4
5
6
var doc = $Documents.New('My Document');
doc.Files.AddPDF('<p>Hello</p>', 'report.pdf'); // content of a document
doc.Publish('myfolder;otherfolder'); // folders in which the document will be published (this is very important for saving a new document)

doc.Title = 'Sample Document'; // making some changes on an existing document
doc.Save(); // persist the title; the version remains Published

See Also