Das Notes Forum

Domino 9 und frühere Versionen => ND8: Entwicklung => Thema gestartet von: rambrand am 07.05.13 - 15:09:22

Titel: NotesUIDocument.DeleteDocument und dann?
Beitrag von: rambrand am 07.05.13 - 15:09:22
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
Titel: Re: NotesUIDocument.DeleteDocument und dann?
Beitrag von: Klafu am 07.05.13 - 15:31:20
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
Titel: Re: NotesUIDocument.DeleteDocument und dann?
Beitrag von: rambrand am 07.05.13 - 15:41:50
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.


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
Titel: Re: NotesUIDocument.DeleteDocument und dann?
Beitrag von: cebolina am 07.05.13 - 15:44:46
@Markus

Suche in der Hilfe nach den NotesDocument-Methoden "Remove" oder "RemovePermanently" anstatt der NotesUIDocument-Methode "Delete".

Gruß Stefan