ParameterDocID gets only 6 digit of my DocumentUni

2019-07-26 15:20发布

Im calling from my Javascript application a specific IBM Notes agent. The call from Javascript to Notes agent happens with a parameter. This parameter is the Universal ID.

Unfortunately, my Agent gets only the 6 digit of my Universal ID (DocumentUniqueID). But I would like to have the full length of my UniversalID. What is missing, any idea?

My Javascript:

//more code before....

var UID = new String
UID$ = doc.getUniversalID()

// notes agent
var notesAgent = db.getAgent("NameOfMyNotesAgent");

// execute notes agent
var agentResult = notesAgent.runOnServer(UID$)

If I output my UID, its the full length of the Universal ID. This is no issue.

My Notes Agent (NameOfMyNotesAgent):

Dim agent As NotesAgent
Dim sess As New NotesSession    
Dim db As NotesDatabase

Set db = sess.CurrentDatabase   
Set agent = sess.CurrentAgent

Dim docUID As String    
docUID = agent.ParameterDocID

'Display Notes document UID
Print "******************************"
Print "Notes Document UID: " & docUID
Print "******************************"
' I only get the last 6 part of the DocumentUniqueID, not the full one. Why?

Edit:

I get the information from Knut Herrmann that this has to do with runOnServer which only accepts noteID.

Due to the NoteId changes in different replicas I would like to do this with DocumentUniqueID. Which way could I use for this, is there an alternative way?

1条回答
2楼-- · 2019-07-26 15:43

Agent's runOnServer(String noteID) accepts only the noteId as parameter, not the UniversalId.

So, change your code to

var noteID = doc.getNoteID()
...
var agentResult = notesAgent.runOnServer(noteID)
查看更多
登录 后发表回答