Search code examples
lotus-noteslotusscript

Storing the Unique ID of the Document in Web


I need to save or store the current document unique or universal ID in web lotus notes application. I tried using @Text(@DocumentUniqueID) but it doesn't work and as I researched about it, it wouldn't really work. Is there another way? Currently I am opening a new form through open agent in web then I need to store the unique id so they would be related. I am not sure if this question is already answered but I can't find the answer.. I need to ask since I have a deadline..


Solution

  • You can use WebQuerySave event of your form to set the Universal ID.

    Say you create an agent aSetUNID and call it from WebQuerySave

    @Command([ToolsRunMacro]; "aSetUNID");
    

    In your agent aSetUNID you would write something like this:

    Dims s as New NotesSession
    Dim doc as NotesDocument
    Set doc = s.DocumentContext
    Call doc.ReplaceItemValue("DocUNID_Field", doc.UniversalID)