LOTUSSCRIPT /COM/OLE のクラス
例:AutoUpdate プロパティ
1. 次の QueryRecalc イベントは、AutoUpdate を False に設定するため、処理中にビューが繰り返し更新されることはありません。
Sub Queryrecalc(Source As Notesuiview, Continue As Variant)
Dim view As NotesView
Dim doc As NotesDocument
Set view = Source.View
view.AutoUpdate = False
Set doc = view.GetFirstDocument
Do While Not doc Is Nothing
Call doc.ReplaceItemValue("Categories", _
doc.Categories(0) & "0")
Call doc.Save(True, False)
Set doc = view.GetNextDocument(doc)
Loop
End Sub
2. 次のエージェントは、分類されていないビューを取得した後で文書を作成します。AutoUpdate を False に設定してからビューをナビゲートするため、新しい文書は処理されません。これは、最上位レベルのエントリ数が処理前後で変わらないことからわかります。
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Set db = session.CurrentDatabase
Set view = db.GetView("All")
Messagebox view.TopLevelEntryCount,, view.Name
Dim doc As New NotesDocument(db)
Call doc.ReplaceItemValue("Form", "Main Topic")
Call doc.ReplaceItemValue("Subject", "New document")
Call doc.Save(True, True)
view.AutoUpdate = False
Set doc = view.GetFirstDocument
While Not(doc Is Nothing)
Set doc = view.GetNextDocument(doc)
Wend
REM The entry count is the same
REM because the view is not automatically refreshed when
REM GetFirstDocument or GetNextDocument accesses the
REM new document
Messagebox view.TopLevelEntryCount,, view.Name
End Sub
3. 次のエージェントは、分類されていないビューを取得した後で文書を作成します。AutoUpdate がデフォルトの False のままでビューをナビゲートするため、新しい文書が処理されます。これは、処理の後に最上位レベルのエントリ数が増加することからわかります。
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Set db = session.CurrentDatabase
Set view = db.GetView("All")
Messagebox view.TopLevelEntryCount,, view.Name
Dim doc As New NotesDocument(db)
Call doc.ReplaceItemValue("Form", "Main Topic")
Call doc.ReplaceItemValue("Subject", "New document")
Call doc.Save(True, True)
Set doc = view.GetFirstDocument
While Not(doc Is Nothing)
Set doc = view.GetNextDocument(doc)
Wend
REM The entry count is incremented reflecting the
REM new document
REM because the view is automatically refreshed when
REM GetFirstDocument or GetNextDocument accesses the
REM new document
Messagebox view.TopLevelEntryCount,, view.Name
End Sub
関連項目
AutoUpdate プロパティ
用語集
フィードバック
ヘルプ
または
プロダクトユーザビリティ
ヘルプの使い方
すべてのヘルプ項目
用語集