Skip to content

New

Creates an unsaved Draft document with new version and branch IDs, initially version 1.0.0.

1
$Documents.New(title: string, contentType?: string):Document

Parameters

string title
    The title of the document.

string contentType optional
    Optional published content type name or ID for the profile form.

Returns

The new unsaved document.

Examples

Create and publish a document

1
2
3
var doc = $Documents.New('Service Agreement', 'Contract');
doc.Files.AddString($Xml.Evaluate('ContractText'), 'contract.txt');
doc.Publish('Contracts');

See Also