Document

Methods

(inner) addToFolder()

Adds current document to one folder while removing it from another. NULL string can be substituted for either argument to skip the action.

To Do
  • this needs to be implemented
Throws:

method not implemented

Type
Error

(inner) all() → {Promise.<any>}

Returns the value True.

See
Returns:
Type: 
Promise.<any>

(inner) attachmentLengths(excludeMIMEBody)

Returns a number or a number list containing the length of each attachment to the current document. The number(s) returned are only approximations; the actual size(s) of the attachment(s) may be slightly different.

Parameters:
NameTypeDefaultDescription
excludeMIMEBodybooleantrue
To Do
  • this needs to be implemented
Throws:

method not implemented

Type
Error

(inner) attachmentModifiedTimes(excludeMIMEBody)

Returns a datetime that displays the date on which the file attachment associated with the current document was last modified. If the document contains more than one file attachment, returns the modification dates in a datetime list.

Parameters:
NameTypeDefaultDescription
excludeMIMEBodybooleantrue
To Do
  • this needs to be implemented
Throws:

method not implemented

Type
Error

(inner) attachmentNames(excludeMIMEBody) → {TextOrTextList}

Returns the operating system file names of any files attached to a document. If there are multiple files attached, the names are returned as a multiple-value text list.

Parameters:
NameTypeDefaultDescription
excludeMIMEBodybooleantrue
See
Returns:
Type: 
TextOrTextList

(inner) attachments(excludeMIMEBody) → {number}

Returns the number of files attached to a document.

Parameters:
NameTypeDefaultDescription
excludeMIMEBodybooleantrue
See
Returns:
Type: 
number

(inner) author() → {Array.<string>}

Returns a text list containing the names of the author(s) of the current document.

See
Returns:

All the authors of the current document. For authors with hierarchical names, Notes/Domino returns the abbreviated form of the name (as in Denise Lee/Research/Acme), rather than the canonical form (CN=Denise Lee/OU=Research/O=Acme).

Type: 
Array.<string>
Example
// If a document has one Authors field that contains: Mary Tsen, David Smith, Denise Lee/Research/Acme. This example returns: ["Mary Tsen", "David Smith", "Denise Lee/Research/Acme"]
rosettajs.Document.author();

(inner) chooseFolders()

Displays the Folders dialog box, which allows you to select a folder in which to file the current document.

Throws:

no plans to implement

Type
Error

(inner) deleteDocument() → {Promise.<any>}

Deletes the current document.

See
Returns:
Type: 
Promise.<any>

(inner) deleteField() → {void}

Deletes the value of an editable field.

See
Returns:
Type: 
void

(inner) discoverFolders()

Displays the "Folders containing current document" dialog box.

Throws:

no plans to implement

Type
Error

(inner) docChildren(string1, string2, string3) → {string}

Returns the number of child documents or categories belonging to the current document or category. Only immediate responses count as children. For example, the responses to a main document are its children, but the responses to a response document are not.

The parameter descriptions are:

  • defaultString The text to return. If a "%" is used in the string, it will be replaced with the number of children documents or categories. Example: "% Responses."
  • zero-string The text to return if the document or category has no children, such as "No Responses."
  • one-string The text to return if the document or category has just one child, such as "One Response."
Parameters:
NameTypeDescription
string1string

If this is the only argument, it is the defaultString. If there are more than two arguments, this is the zero-string.

string2string

If there are two arguments, it is the defaultString. If there are three arguments, this is the one-string.

string3string

This is the defaultString.

See
Returns:

The return value depends on how you call docChildren:

  • numChildren If docChildren is called with no parameters, then the number of child documents belonging to the current document or category is returned. You cannot convert special text to a number.
  • childString If docChildren is called with one or more parameters, it returns the appropriate string, based on the number of child documents belonging to the current document or category. You cannot convert special text to a number.
Type: 
string
Examples
rosettajs.document.docChildren(); // This example returns 3 if there are 3 responses
// This example returns 3 Responses. The appropriate number is substituted for %. If the document doesn't have any responses, this formula returns 0 Responses.
rosettajs.document.docChildren("% Responses");
// This example returns 3 Responses. This time, if the document doesn't have any responses, the formula returns the message No Responses.
rosettajs.document.docChildren("No Responses";"% Responses");
// This example returns There are 3 Responses. If the document has one response, the message is 1 Response; if the document has no responses, the message is No Responses.
rosettajs.document.docChildren("No Responses";"1 Response";"There are % Responses.");

(inner) docDescendants(string1, string2, string3) → {string}

Returns the number of descendant documents or subcategories belonging to the current document or category. Only immediate responses count as children. Where docChildren only counts direct descendants, docDescendants counts all descendants, regardless of level.

The parameter descriptions are:

  • defaultString The text to return. If a "%" is used in the string, it will be replaced with the number of descendant documents or categories. Example: "% Responses."
  • zero-string The text to return if the document or category has no descendants, such as "No Responses."
  • one-string The text to return if the document or category has just one descendant, such as "One Response."
Parameters:
NameTypeDescription
string1string

If this is the only argument, it is the defaultString. If there are more than two arguments, this is the zero-string.

string2string

If there are two arguments, it is the defaultString. If there are three arguments, this is the one-string.

string3string

This is the defaultString.

See
Returns:

The return value depends on how you call docDescendants:

  • numDescendants If docDescendants is called with no parameters, then the number of descendant documents belonging to the current document or category is returned.
  • descendantString If docDescendants is called with one or more parameters, it returns the appropriate string, based on the number of descendant documents belonging to the current document or category.
Type: 
string
Examples
rosettajs.document.docDescendants(); // This example returns 3 if there are 3 responses
// This example returns 3 Responses. The appropriate number is substituted for %. If the document doesn't have any responses, this formula returns 0 Responses.
rosettajs.document.docDescendants("% Responses");
// This example returns 3 Responses. This time, if the document doesn't have any responses, the formula returns the message No Responses.
rosettajs.document.docDescendants("No Responses";"% Responses");
// This example returns There are 3 Responses. If the document has one response, the message is 1 Response; if the document has no responses, the message is No Responses.
rosettajs.document.docDescendants("No Responses";"1 Response";"There are % Responses.");

(inner) docFields()

Returns a list of all the fields in a document.

To Do
  • this needs to be implemented
Throws:

method not implemented

Type
Error

(inner) docLength()

Returns the approximate size of a document in bytes.

Throws:

No plans to implement

Type
Error

(inner) docLevel()

Returns a text string that represents the level of the document or category.

See
Returns:

The level of the document or category.

Examples
rosettajs.Document.docLevel(); // This example of a main document in a category returns 2
rosettajs.Document.docLevel; // This example of a response document in a category returns 3

(inner) docLock()

Locks, unlocks, returns the locked status of the current document, or indicates if a database has document locking enabled.

Throws:

no plans to implement

Type
Error

(inner) docMark()

In an agent that runs a formula, indicates whether or not you want to save the changes to a document.

Throws:

No plans to implement

Type
Error

(inner) docNumber(separatoropt)

Returns a string representing the entry number of the current document or category. For example, 2.3 indicates that the document is the third entry following the second entry.

Parameters:
NameTypeAttributesDescription
separatorstring<optional>

Optional. Indicates a separator to be used in the document number instead of "." (period); must be one character. An empty string (""), Tells the function to return the least significant item of the document number (in other words, its rightmost component).

See
Returns:

The value that represents the document number of the document or category in the view.

Examples
rosettajs.Document.docNumber(); // This example returns 37.1.3 for entry 37.1.3
rosettajs.Document.docNumber("-"); // This example returns 37-1-3 for entry 37.1.3
rosettajs.Document.docNumber(""); // This example returns 3 for entry 37.1.3

(inner) docOmmittedLength()

Returns the approximate number of bytes a truncated document lost during replication. The bytes are the total number of bytes per attachment, OLE object, large rich text field, or non-summary items that were too large, according to the replication settings for the database, to be replicated.

Throws:

no plans to implement

Type
Error

(inner) docParentNumber(separatoropt) → {string}

Returns a string that represents the entry number of the parent view entry. Both the current view entry and the parent can be either documents or categories.

Parameters:
NameTypeAttributesDescription
separatorstring<optional>

Optional. Indicates a separator to be used in the parent document number instead of "." (period); must be one character. An empty string (""), Tells the function to return the least significant item of the parent document number (in other words, its rightmost component).

See
Returns:

The value that represents the parent document number of the document or category in the view.

Type: 
string
Examples
rosettajs.Document.docParentNumber(); // This example returns 37.1 for entry 37.1.3
rosettajs.Document.docParentNumber("-"); // This example returns 37-1 for entry 37.1.3
rosettajs.Document.docParentNumber(""); // This example returns 1 for entry 37.1.3

(inner) docSiblings() → {string}

Returns a string that represents the total number of entries at the same level as a view entry (document or category). The returned total includes the document itself. For example, if the document is entry 8.2, and entries 8.1, 8.3, and 8.4 also exist, then there are four document siblings.

See
Returns:

The number of entries at the same level as the document or category.

Type: 
string
Example
// Returns Response 1 of 4 to Current Vacation Policy if the document is one of four responses to a document with the string Current® Vacation Policy in the Topic field
if (voltmx.rosettajs.Document.isNewDoc()) {
 return "New Document";
} else {
return "Response " + voltmx.rosettajs.Document.docNumber(" ") + " of " + voltmx.rosettajs.Document.docSiblings() + " to " + voltmx.rosettajs.Document.getField("Topic");
}

(inner) documentUniqueID() → {string}

The universal ID, which uniquely identifies a document across all replicas of a database. In text format, the universal ID is a 32-character combination of hexadecimal digits (0-9, A-F).

The universal ID is also known as the unique ID or UNID.

See
Returns:
Type: 
string

(inner) emptyTrash()

Deletes documents marked for deletion in a database.

To Do
  • this needs to be implemented
Throws:

method not implemented

Type
Error

(inner) formLanguage()

Returns the language of the current form.

Throws:

no plans to implement

Type
Error

(inner) formTestDocument()

Creates a document using the current form or Page, so you can test its fields, formulas, and scripts.

Throws:

no plans to implement

Type
Error

(inner) getField(fieldName) → {*}

Returns the value of a specified field.

Parameters:
NameTypeDescription
fieldName*
See
Returns:

value

Type: 
*

(inner) getFieldType(fieldName) → {*}

Returns the type of a specified field.

Parameters:
NameTypeDescription
fieldName*

uses current document

Returns:

field type - possible return values - 'string', 'number', 'date', 'richtext', 'string[]', 'number[]', 'date[], 'richtext[]', and []'

Type: 
*

(inner) getFocusTable()

Returns the name, current row, or current column of the table that is in focus.

Throws:

No plans to implement

Type
Error

(inner) hardDeleteDocument()

In an agent that runs a formula, @HardDeleteDocument permanently removes the document currently being processed from the database if the database has soft deletions enabled. If the database does not have soft deletions enabled, @HardDeleteDocument performs the same action as @DeleteDocument.

To Do
  • this needs to be implemented
Throws:

method not implemented

Type
Error

(inner) inheritedDocumentUniqueID()

The unique ID of the current document's inheritance parent. See @documentUniqueID for a description of unique IDs.

Throws:

No plans to implement

Type
Error

(inner) isAvailable(field)

Checks a document for the existence of a field.

Parameters:
NameTypeDescription
field*

The field to check

See
Returns:

True indicates that the field is contained in the document. False indicates that the field is not contained in the document.

Examples
// This formula returns the value of the Dept field if it exists in the document, otherwise it returns Consultant
if (voltmx.rosettajs.Document.isAvailable("Dept")) {
 return voltmx.rosettajs.Document.getField("Dept");
} else {
  return "Consultant";
}
// This formula returns the value of the field named Topic if it exists in the document, otherwise it returns the value contained in the field named Subject.
if (voltmx.rosettajs.Document.isAvailable("Topic")) {
  return voltmx.rosettajs.Document.getField("Topic");
} else {
  return voltmx.rosettajs.Document.getField("Subject");
}
// This formula, when added to a hotspot button, checks for the existence of the Priority field in a form, then sets its value if found or creates a new Priority field and sets its value, if not found
if (voltmx.rosettajs.Document.isAvailable("Priority")) {
  return voltmx.rosettajs.Document.setField("Priority", "High");
} else {
  return voltmx.rosettajs.Document.setField("Priority", "Medium");
}

(inner) isCategory(trueStringopt, falseStringopt)

Returns a specified string if the current document of a view is defined as a category.

Parameters:
NameTypeAttributesDescription
trueStringstring<optional>

A string to return if an item in the view row is a category.

falseStringstring<optional>

A string to return if no item in the row is a category.

See
Returns:

If no parameters are specified, the function returns an asterisk (*) if the current document is a category. Otherwise returns an empty string. If trueString is specified, returns trueString instead of asterisk (*). If falseString is specified, returns falseString instead of an empty string.

Examples
// This example returns * if the row is a category, or nothing if the row is not a category.
voltmx.rosettajs.isCategory();
// This example returns C if the row is a category, or nothing if the row is not a category.
voltmx.rosettajs.isCategory("C");
// This example returns Y if the row is a category, or N if the row is not a category.
voltmx.rosettajs.isCategory("Y", "N");

(inner) isDocBeingEdited()

Checks the current status of the document and returns 1 (True) if the document is being edited; otherwise returns 0 (False).

Throws:

No plans to implement

Type
Error

(inner) isDocBeingLoaded()

Checks the current status of the document and returns 1 (True) if the document is being loaded into memory for display; otherwise returns 0 (False).

Throws:

No plans to implement

Type
Error

(inner) isDocBeingMailed()

Checks the current status of the document and returns 1 (True) if the document is being mailed; otherwise, returns 0 (False).

Throws:

No plans to implement

Type
Error

(inner) isDocBeingRecalculated()

Checks the current status of the document and returns 1 (True) if the document is being recalculated; otherwise, returns 0 (False).

Throws:

No plans to implement

Type
Error

(inner) isDocBeingSaved()

Checks the current status of the document and returns 1 (True) if the document is being saved; otherwise, returns 0 (False).

Throws:

No plans to implement

Type
Error

(inner) isDocTruncated()

Indicates whether the current document has been truncated.

Throws:

no plans to implement

Type
Error

(inner) isNewDoc()

For a document being edited, indicates if the document has been saved to disk.

See
Returns:

1 (True) if the document being edited has not yet been saved to disk. Returns 0 (False) if the document has been saved.

(inner) isResponseDoc()

Indicates whether a document is a response to another document.

See
Returns:

Returns true if the document is a response document. Returns false if the document is not a response document. Returns false for new documents, since @IsResponseDoc doesn't recognize a document type until after the document is saved

Example
// Returns Response if the document is a response; Topic if the document is not a response.
if (voltmx.rosettajs.Document.isResponseDoc()) {
 return "Response";
} else {
return "Topic";
}

(inner) isUnavailable(field)

Indicates whether a field name exists in a document.

CAUTION: Do not confuse @IsUnavailable with @Unavailable. @Unavailable deletes fields and can cause serious damage if used unintentionally in place of @IsUnavailable.

Parameters:
NameTypeDescription
field*

The field to check.

See
Returns:

True indicates that the field is not contained in the document. False indicates that the field is contained in the document.

Example
// Returns Consultant if the field Dept does not exist; if Dept does exist, the value contained in Dept is returned.
if (voltmx.rosettajs.Document.isUnavailable("Dept")) {
  return "Consultant";
} else {
  return voltmx.rosettajs.Document.getField("Dept");
}

(inner) moveToTrash()

Marks the currently selected document for deletion.

To Do
  • this needs to be implemented
Throws:

method not implemented

Type
Error

(inner) noteID()

The ID number of the current document.

Throws:

No plans to implement

Type
Error

(inner) openInNewWindow()

Opens the specified document within a new window.

To Do
  • this needs to be implemented
Throws:

method not implemented

Type
Error

(inner) pickList()

Displays a modal window that contains either:

  • A view you specify from which the user can select one or more documents. @pickList returns a column value from the selected document(s).
  • A dialog box, displaying information from all available Domino® Directories. The user can select one or more person, group, server, room, or resource names, and @pickList returns those names.
To Do
  • this needs to be implemented
Throws:

method not implemented

Type
Error

(inner) policyIsFieldLocked()

Indicates whether a field is locked by an administration policy and cannot be modified.

Throws:

No plans to implement

Type
Error

(inner) prompt(style, title, promptStringopt, defaultChoiceopt, choiceListopt)

Get html to generate a prompt.

Parameters:
NameTypeAttributesDescription
style

The type of prompt to generate

title

The title for the prompt

promptString<optional>

Optional. Text to display with the prompt

defaultChoice<optional>

Optional. Default choice to select when the prompt is displayed.

choiceList<optional>

Optional. The list of avaliable choices

See
Returns:

A promise that will inject the code for the prompt into the document.

(inner) removeFromFolder()

Removes the selected document from the current folder.

To Do
  • this needs to be implemented
Throws:

method not implemented

Type
Error

(inner) responses() → {number}

Returns the number of responses (in the current view) to the document.

See
Returns:

value. The number of responses to the document.

Type: 
number
Examples
// Returns 5 if there are five responses to the document.
voltmx.rosettajs.responses();
// Returns the string "No one has responded to this document" if there are no responses to the current document; otherwise a blank is returned.
if (voltmx.rosettajs.responses() === 0) {
 return "No one has responded to this document";
} else {
return " ";
}

(inner) setField(fieldName, value)

Assigns a value to a field stored within a document (use @set for temporary variables). This is similar to using the FIELD keyword, except that @setField can be used within another @function. If the field does not exist, this command creates it and applies the specified value to it.

Parameters:
NameTypeDescription
fieldNamestring

The name of a field in the current document.

value*

The value to set the field.

See

(inner) setTargetFrame()

Allows you to specify a target frame when opening a view, page, or frameset, or when composing or editing a document.

Throws:

no plans to implement

Type
Error

(inner) showParentPreview()

Displays the parent document preview pane.

Throws:

no plans to implement

Type
Error

(inner) showProperties()

Displays the Properties box for the currently selected Notes® object. For example, if a document is selected in a view, displays the document Properties box; if a field is selected on a form, displays the field Properties box.

Throws:

no plans to implement

Type
Error

(inner) switchForm()

Changes the form used to display the current document.

Throws:

no plans to implement

Type
Error

(inner) unavailable()

Deletes the value of an editable field.

Throws:

No plans to implement

Type
Error

(inner) undeleteDocument()

In a database with "Allow soft deletions" selected, this command restores a deleted document.

To Do
  • this needs to be implemented
Throws:

method not implemented

Type
Error

(inner) v3EditNextField()

In a document in Edit mode, moves the insertion point to the next editable field.

Throws:

no plans to implement

Type
Error

(inner) v3EditPrevField()

In a document in Edit mode, moves the insertion point to the first editable field.

Throws:

no plans to implement

Type
Error

(inner) whichFolders()

Returns the names of the folders containing the current document.

Throws:

no plans to implement

Type
Error