Javascript ParameterDocID仅获取DocumentUniqueID的6位数字
我从Javascript应用程序调用一个特定的IBMNotes代理。Javascript对Notes代理的调用是通过一个参数进行的。此参数是通用ID 不幸的是,我的代理只获得我的通用ID(DocumentUniqueID)的6位数字。但我想把我的大学文凭完整地写下来。有什么遗漏,知道吗 我的Javascript:Javascript ParameterDocID仅获取DocumentUniqueID的6位数字,javascript,lotus-notes,lotus-domino,lotusscript,lotus,Javascript,Lotus Notes,Lotus Domino,Lotusscript,Lotus,我从Javascript应用程序调用一个特定的IBMNotes代理。Javascript对Notes代理的调用是通过一个参数进行的。此参数是通用ID 不幸的是,我的代理只获得我的通用ID(DocumentUniqueID)的6位数字。但我想把我的大学文凭完整地写下来。有什么遗漏,知道吗 我的Javascript: //more code before.... var UID = new String UID$ = doc.getUniversalID() // notes agent var
//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$)
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?
如果我输出UID,它是通用ID的完整长度。这不是问题
我的Notes代理(MyNotes代理的名称):
//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$)
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?
编辑:
//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$)
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?
我从Knut Herrmann那里得到的信息是,这与只接受noteID
的runOnServer有关
由于不同副本中的NoteId发生了变化,我希望使用DocumentUniqueID
执行此操作。我可以使用哪种方法,有其他方法吗?代理的runOnServer(字符串noteID)
只接受noteID作为参数,而不接受UniversalId
因此,将代码更改为
var noteID = doc.getNoteID()
...
var agentResult = notesAgent.runOnServer(noteID)
啊,现在我明白了。那太糟糕了。我在上一个问题中得到了Torsten Link的建议,不要使用noteID。原因是,如果有db的副本,该值可以更改。这就是为什么我更喜欢这种方式而不是文档唯一性。我怎么能意识到使用DocumentUniqueID——任何可能的解决方案?Torsten的建议不适用于这种情况。您已经有了一个doc对象。现在,您用noteID指向此文档,并立即调用runOnServer。这是安全的。别误会我:正确的工具,正确的问题。。。您从当前文档中获取NoteID,runOnServer需要一个NoteID。。。所以使用NoteID没有什么错。当使用noteid硬编码或在多个服务器上使用它时,使用noteid只是一个坏主意。。。对于这个例子,它是完美的。。现在我明白了。非常感谢你们两位,并对目前的情况表示歉意。另外,永远不要存储NoteID以便以后使用。当你使用它的时候,它可能已经改变了。