Domino 9 und frühere Versionen > ND8: Entwicklung
NotesUIDocument.DeleteDocument und dann?
(1/1)
rambrand:
Hallo,
wahrscheinlich eine Newbie-Frage:
Mit NotesUIDocument.DeleteDocument markiere ich ein Dokument zur Löschung.
Und wie führe ich die Löschung des Dokuments dann aus?
Wenn ich später in eine Debug-Ansicht mit allen Dokumenten schaue, sehe ich die Dokumente auch immer schön mit dem X davor.
Gruß,
Markus
Klafu:
Wie rufst du das denn auf?
Zeig mal ein bisschen Code.
Edit: Es tut also was es soll: Beispiel aus dem Notes Designer (war nicht schwer zu finden ;) )
--- Code: ---
Examples: DeleteDocument method
This script closes the current document and marks it for deletion. If the document is in Edit mode, however, the script does nothing.
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
If Not ( uidoc.EditMode ) Then
Call uidoc.DeleteDocument
End If
End Sub
[b]
Usage: The document is not actually deleted from the database until the user refreshes the view or closes the database, and chooses to delete the marked document.[/b]
If the current document is already marked for deletion, this method closes the document, leaving the deletion mark in place.
End If
--- Ende Code ---
rambrand:
Hi Klafu,
ja es tut ja auch genau, das was es soll. Es markiert das Dokument zur Löschung.
Ich hab in der Online-Hilfe nur den einen Satz übersehen.
--- Zitat ---
Usage: The document is not actually deleted from the database until the user refreshes the view or closes the database, and chooses to delete the marked document.
--- Ende Zitat ---
Ich muss also dann noch in die View gehen und die refreshen. Dann sollte das Dokumente weg sein.
Wer lesen kann ist eindeutig im Vorteil.
Gruß,
Markus
cebolina:
@Markus
Suche in der Hilfe nach den NotesDocument-Methoden "Remove" oder "RemovePermanently" anstatt der NotesUIDocument-Methode "Delete".
Gruß Stefan
Navigation
[0] Themen-Index
Zur normalen Ansicht wechseln