Skip to content

Publish

Publishes the document to the specified folders and returns the current document instance.

1
myDocument.Publish(folderPath: string):Document

Publishes and saves this version without adding folder associations.

1
myDocument.Publish():Document

Parameters

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

Returns

The current Document instance.

Remarks

This method changes the State property to "Published" and saves the document.

Adds folder associations for the document family (BranchId). Pass multiple paths as one semicolon-separated string, not an array or a folder GUID. Use backslashes between path components and escape them in JavaScript literals. Missing folders are created. Folder membership does not grant document Read access.

After creating a new document, it's better to use this function instead of just Document.Save(). This function will save the document in a folder where it can be accessed, and not just in the system without an access point like Document.Save().

Publish a document to multiple folders

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

doc.Title = 'Sample Document';
doc.Publish('Testing\\Folder1;Testing\\Folder2');
Existing family folder associations remain. If the family has no folder association, this method does not create a folder entry. Pass a path to the other overload when a destination is required.

See Also