看帮助代码!
This script reminds project participants of their due date by mailing them a Project document from a database. The ReminderDate item on each document is used to indicate when a reminder should be sent. The Search method gets all Project documents whose ReminderDate item is set to today, mails the document, and updates the ReminderDate field to one week later.
Sub Initialize
Dim db As New NotesDatabase("","reminder.nsf")
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim dateTime As New NotesDateTime("12/01/94")
Dim nextDateTime As NotesDateTime
searchFormula$ = "Form = ""Project"" _
& ReminderDate = @Today"
Set collection = db.Search(searchFormula$,dateTime,0)
' Create a date that's one week from today.
' That's when the project participants
' get their next reminder.
Set nextDateTime = New NotesDateTime("Today")
Call nextDateTime.AdjustDay(7)
' For each document with reminder date today,
' send document to project participants
' Then update the ReminderDate field
' with a date one week from today.
For i = 1 To collection.Count
Set doc = collection.GetNthDocument(i)
Call doc.Send( True )
Call doc.ReplaceItemValue("ReminderDate", _
nextDateTime.LSLocalTime )
Call doc.Save( True, False )
Next
End Sub
HasDoc = False
Result = Evaluate(|@DBColumn("":"NoCache";@DBName;"ViewName";3)|)
If Result(0) <> "" Then
Forall ColumnValue in Result
If ColumnValue = "123" Then
HasDoc = True
……
Exit Forall
End If
End Forall
End If
fengyi999(多尔滚) :
我的视图就是你说的还是不行,代码是这样的:
Set db=s.currentdatabase
Set curdoc=s.documentcontext
Set v=db.getview("VFlow")
Set doc=v.getdocumentbykey(curdoc.splc(0))
总是在服务器中报:couldn't get default view id for database