UniversalID (NotesDocument - JavaScript)

Read-Write. The universal ID, which uniquely identifies a document across all replicas of a database.

Defined in

NotesDocument

Syntax

getUniversalID() : string

setUniversalID(unid:string) : void

Usage

In character 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.

If two documents in replica databases share the same universal ID, the documents are replicas.

If you modify the UNID of an existing document, it becomes a new document.

Saving a document with the same UNID as an existing document results in an exception.

See @DocumentUniqueID for another way to get the Universal ID of a document and more information.

Examples

This is the XML for a data table. Its returns all documents and the current document (the document for the currently selected row) is accessible through the variable rowdoc. A button in the second column opens a page in edit mode specifying its content with the universal ID of the current document in the table.
<xp:dataTable id="dataTable1" rows="30" value="#{javascript:return database.getAllDocuments()}" var="rowdoc">
<xp:column id="column1">
	<xp:text escape="true" id="computedField3"><xp:this.value>
	<![CDATA[#{javascript:return rowdoc.getItemValueString("subject")}]]></xp:this.value></xp:text>
	<xp:this.facets><xp:label value="subject" id="label1" xp:key="header"></xp:label></xp:this.facets>
</xp:column>
<xp:column id="column2">
	<xp:button value="edit" id="button6"><xp:eventHandler event="onclick" submit="true" refreshMode="complete">
	<xp:this.action>
		<xp:openPage name="/main2.xsp" target="editDocument"
			documentId="#{javascript:rowdoc.getUniversalID()}">
		</xp:openPage>
	</xp:this.action></xp:eventHandler></xp:button>
</xp:column>
</xp:dataTable>