getUniversalID (NotesXspViewEntry - JavaScript)

Gets the universal ID of a document associated with a view entry. The ID is a 32-character combination of hexadecimal digits (0-9, A-F) that uniquely identifies a document across all replicas of a database.

Defined in

NotesXspViewEntry (JavaScript)

Syntax

getUniversalID() : string

Usage

This method returns the empty string for entries of type category and total.
Return value Description
string The universal ID of the document.

Examples

This value script for a Computed Field is embedded in a Data Table control with a Domino® view data source whose collection name is rowdata. The script gets the value of a document item.
try {
	if (rowdata.isDocument()) {
		var doc:NotesDocument = database.getDocumentByUNID(rowdata.getUniversalID());
		return doc.getItemValue("subject").elementAt(0);
	}
} catch (e) {
	return e.toString()
}
This XML for a Button control is embedded in a Data Table control with a Domino® view data source whose collection name is rowdata. The button uses a script get the ID of the document to be accessed by an Open Page simple action.
<xp:button id="button1" value="open"><xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
	<xp:openPage name="/documentread.xsp" target="openDocument"
		documentId="#{javascript:database.getDocumentByUNID(rowdata.getUniversalID())}">
	</xp:openPage>
</xp:this.action></xp:eventHandler></xp:button>