Domino 9 und frühere Versionen > Entwicklung
doppelte Einträge dürfen nicht
Axel:
Hi,
ganz grob könnte das in Script so aussehen:
Gesucht wird in der Ansicht All nach dem Inhalt des Feldes Geraetename. Die Ansicht All muß in der ersten Spalte die Werte des Feldes Geraetename anzeigen und muß sortiert sein.
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim view As NotesView
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim tmpdoc As NotesDocument
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Set db = session.CurrentDatabase
Set view = db.GetView( "All" ) 'Name der Ansicht mit allen Dokumenten
Set tmpdoc = view.GetDocumentByKey( doc.Geraetename(0) )
If tmpdoc Is Nothing Then
'Gerät noch nicht vorhanden
Else
'Gerät bereits in der Datenbank vorhanden
End If
Axel
Raul:
Thx Raul
Raul:
Hi...
wenn ich ein bestehendes Document edietiere und verändere kann ich es nicht speicher...dies sollte möglich sein.
Habe ich irgendwas falsch gemacht???
Gruss Raul ???
Axel:
Hi,
du mußt noch eine Abfrage einbauen, ob es sich um ein neues oder bestehendes Dokument handelt.
Versuch's mal so:
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim view As NotesView
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim tmpdoc As NotesDocument
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Set db = session.CurrentDatabase
Set view = db.GetView( "All" ) 'Name der Ansicht mit allen Dokumenten
If doc.IsNewNote Then 'Prüfung auf doppelte Dokumente nur wenn Dokument neu
Set tmpdoc = view.GetDocumentByKey( doc.Geraetename(0) )
If tmpdoc Is Nothing Then
'Gerät noch nicht vorhanden
Else
'Gerät bereits in der Datenbank vorhanden
End If
End If
Axel
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln