Hoe Can I Grab UNID from documents?

I’m building a form which will populate information about documents selected by the user.

I have fields which pulls current live information from using the DBLookup. 1 field I want it to display the UNID for that document, which the user chose.

I tried the following:

@If(ARInfo2 = “”; @Return(" "); @Success);

getID := @DbLookup(“”:“NoCache”; @DbName; “ARBTS”; ARInfo2; @Text(@DocumentUniqueID));

@If(@IsError(getID); “Error Loading Information”; getID)

I don’t get an error, rather just a blank field…What am I doing wrong?

I tried a Rich Text field and removing the @Text() around the @DocumentUniqueID, no error, just a blank field.

Thanks

Subject: Hoe Can I Grab UNID from documents?

Rather than trying to grab the value of the ID programmatically by using @Text(@DocumentUniqueID) in the @DbLookup, use the same formula in a column in the view “ARBTS”. Then, just specify the column number in your @DbLookup.

Subject: RE: Hoe Can I Grab UNID from documents?

Or use

getID := @DbLookup(“”:“NoCache”; @DbName; “ARBTS”; ARInfo2; 1; [ReturnDocumentUniqueId]);

The column number doesn’t really matter in this case.

Subject: RE: Hoe Can I Grab UNID from documents?

That is exactly what I was missing…Thank you!

Thanks to all who replied so quickly…Much appreciated.

Subject: How Can I Grab UNID from documents?

Maybe this LS could help. It works from a view by selecting one or more documents and displays the results, universalID, in the status bar for each doc selected. You can change it to your needs.

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim collection As NotesDocumentCollection

Dim doc As NotesDocument

Dim universalID As String*32

Set db = session.CurrentDatabase

Set collection = db.UnprocessedDocuments

Set doc = collection.GetFirstDocument()



While Not (doc Is Nothing)

	Print doc.UniversalID

	Set doc = collection.GetNextDocument(doc)

Wend

End Sub