entweder generierst Du eine Mail beim Erstellen/Bearbeiten/Ändern/Löschen eines Dokumentes aus DB1, die u.a. auch das Zuordnungsfeld enthält, welches das korrespondierende Dokument in der DB2 identifiziert und welches anpackt werden soll (Zähler um +1). In DB2 läuft dazu ein simpler Mail-In Agent mit entweder einem dblookup oder setdocfield (bei einem benötigst Du auf jeden Fall die DocumentuniqueID des Zieldokuments).
ODER
du schreibst ein Script zB beim Event querysave (wenn Du kein Script kannst, werde ich bewußt kein gesamtes Beispiel reinschreiben):
aus der Notes Help
Examples: FieldSetText method
1. This script sets the value of the Creator field to the user's name after a document is opened in Edit mode. For example, if Brian Flokka creates a new document, the string "Brian Flokka" is placed in the Creator field.
Sub Postopen(Source As Notesuidocument)
Dim session As New NotesSession
If source.EditMode Then
Call source.FieldSetText _
( "Creator", session.CommonUserName )
End If
End Sub
2. This script gets the value of four number fields: Q1, Q2, Q3, and Q4, and converts them to integers using Cint(). It adds the four values together and sets the value of the Total field, using Cstr() to convert the result to a string.
Sub Querysave(Source As Notesuidocument, Continue As Variant)
a% = Cint( source.FieldGetText( "Q1" ) )
b% = Cint( source.FieldGetText( "Q2" ) )
c% = Cint( source.FieldGetText( "Q3" ) )
d% = Cint( source.FieldGetText( "Q4" ) )
Call source.FieldSetText _
( "Total", Cstr( a% + b% + c% + d% ) )
End Sub
Wie spricht man im Script die aktuelle DB und ein aktuelles Doc im Fenster an?
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim composed As String
Set uidoc = workspace.CurrentDocument
composed = uidoc.FieldGetText( "DateComposed" )
Wie spricht man eine andere DB an?
Dim db As NotesDatabase
Set db = New NotesDatabase( "Barcelona", "plan.nsf" )
Messagebox( db.Title )
Wie findet man ein Doc?
This field script gets a user's full name from a field on the current document, parses the full name to find the last name, and then uses GetDocumentByKey to find the user's office phone number in the People view of the Address Book on the current machine. It places the phone number into the Phone field on the current document.
Sub Exiting(Source As Field)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim fullName As String
Dim lastName As String
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
' first parse the full name to find the last name
Set uidoc = workspace.CurrentDocument
fullName = uidoc.FieldGetText( "Name" )
lastName = Mid$( fullName, (Instr( fullName, " ") + 1 ))
' now use the last name as the key
Set db = New NotesDatabase( "", "names.nsf" )
Set view = db.GetView( "People" )
Set doc = view.GetDocumentByKey( lastName )
Call uidoc.FieldSetText _
( "Phone", doc.OfficePhoneNumber( 0 ) )
End Sub