我习惯使用关系数据库,您可以在其中定位特定记录.例如,使用下面的伪sql.
SELECT id, name, otherVar FROM students WHERE id=:studentId
Run Code Online (Sandbox Code Playgroud)
但是,我不确定如何在Lotus Notes中使用其平面数据模型进行处理.我一直在谷歌搜索,但不断提出如何更新Lotus Notes本身的点击,而不是Lotus Notes内部的文档.如果拥有一些LN专业知识的人可以指出我正确的方向,那将非常感激.
使用SQL语句作为类比,假设您有一个students包含列的视图id,name并且otherVar.id应对列进行排序(按升序或降序排列).所以视图看起来像这样
?????????????????????????????????
? id ? name ? otherVar ?
?????????????????????????????????
? 1 ? Daniel ? ---------- ?
? 2 ? Joseph ? ---------- ?
? 3 ? Michelle ? ---------- ?
?????????????????????????????????
Run Code Online (Sandbox Code Playgroud)
要查找此视图,您可以在LotusScript中编写类似的内容:
Dim session As New NotesSession 'Get current session
Dim currentDB As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim studentId As String
studentId = "<STUDENT_ID>" 'The student ID that needs to be searched
Set currentDB = session.CurrentDatabase 'Get current database
Set view = currentDB.GetView("students") 'Get the view
Set doc = view.GetDocumentByKey(studentId, True) 'Look up the view with student ID to get the student document
Run Code Online (Sandbox Code Playgroud)
进行简单的Google搜索以NotesView获取更多信息.在公式语言中,您可以将其编写为:
@DbLookup("Notes":"NoCache"; ""; "students"; "<STUDENT_ID>"; "<FIELD TO BE RETRIEVED>"; [FailSilent]);
Run Code Online (Sandbox Code Playgroud)
但是,如果你想进行复杂的计算,公式就不像LotusScript那么灵活.
| 归档时间: |
|
| 查看次数: |
631 次 |
| 最近记录: |