CreateDocument
Mon 01 January 2018Syntax
CreateDocument(DocumentKey | Package, DocumentName, Version)
Description
Use this method to instantiate a new Document object.
Important! When using this CreateDocument to instantiate a Document object, the object must stay in scope for as long as any child objects (Collection, Compound, or Primitive) generated from this Document object are referenced. Referencing a property on a child object of a Document object that has gone out of scope will result in the PeopleCode program failing to execute properly.
For example if you define a variable as a Document variable as local and instantiate it via CreateDocument within an application class method, any objects created off the Document object must be used within the method itself. If you need to pass references of any of the child objects, then the Document object should be a global variable or defined as part of the application class as a property.
Parameters
Field or Control |
Definition |
---|---|
DocumentKey |
Specifies a DocumentKey object that defines the documentâs package, document name, and version. |
Package |
Specifies a document package as a string. |
DocumentName |
Specifies the name of the document as a string. Note: The document name also becomes the root element name for the document. |
Version |
Specifies the document version as a string. |
Returns
A Document object.