var agent=database.getAgent("AgentDemo");
unid=document1.getDocument().getNoteID();
agent.run(unid);
将文档的NotesID做为参数传递给后端代理以方便后端代理在执行时操作要处理的文档。
注:以上程序是运行在数据源的postSaveDocument事件上
后端代理的程序如下:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim agent As NotesAgent
Dim noteid As String
Set db=session.Currentdatabase
Set agent=session.Currentagent
'返回NotesID通过用户传入的参数ID
noteid=agent.Parameterdocid
Dim memo As String
'获得要操作的文档
Set doc=db.Getdocumentbyid(Noteid)
If doc Is Nothing Then
Print"Document not found"
Exit sub
End If
If doc.a2(0)="" Or doc.a3(0)="" Then
memo="信息不全,没有部门或电话"
Else
memo="个人信息"+doc.a2(0)+"and"+doc.a3(0)
End If
Call doc.Replaceitemvalue("Memo", memo)
Call doc.Save(true, true)
本文介绍了一个使用Lotus Notes开发环境的例子,演示了如何通过后端代理处理特定文档的方法。具体步骤包括从数据源获取文档的NotesID,并将其作为参数传递给后端代理进行进一步处理。
640

被折叠的 条评论
为什么被折叠?



