Hallo Zusammen,
am Ende einer Formel mache ich folgendes:
@Command([FileSave]);
@Command([FileCloseWindow])
trotzdem erscheint die Frage "Speichern? ja nein"
Wie kann ich das verhindern?
Gruß Alfred
Hallo Zusammen,
am Ende einer Formel mache ich folgendes:
@Command([FileSave]);
@Command([FileCloseWindow])
trotzdem erscheint die Frage "Speichern? ja nein"
Wie kann ich das verhindern?
Gruß Alfred
Ersetz das mal durch @PostedCommand statt @Command.
Sonst wird das Save zu früh ausgeführt.
Wenn Du ND6 hast kannst Du das
"@Command([FileCloseWindow])"
auch ersetzen durch
"@Command([CloseWindow])"
Dadurch wird diese Abfrage auch unterbunden und das Dok geschlossen
Vielen Dank,
folgendes funktioniert einwandfrei:
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow])
Gruß Alfred
Gibt es eine ähnliche Methode auch für Lotus Script?
Hi,
call uidoc.save
call uidoc.close
sollten Dir weiterhelfen. uidoc muß natürlich gesetzt sein.
yo... so hatte ich das auch gemacht. Call uidoc.save und Call uidoc.close ans Ende des Scripts gesetzt und der Speichern Dialog kommt immer noch :´(
Hast Du ND6? Wenn ja kann bei dem uidoc.close noch ein optionaler Parameter (true) übergeben werden der die Abfrage nach dem speichern bei uns unterdrückt und gleich schliesst.
Und wo steht das Script ? Wird da vielleicht nachträglich noch etwas verändert ?
Versuch mal vor dem uidoc.Save folgendes:
call uidoc.Refresh
Das berechnet vor dem Speichern alle berechneten Felder.
Eventuell beziehst du dich in einem der berechneten Felder auf eines der Felder das du geändert hast
...hat leider auch nicht geholfen. Ich poste mal den Code.
[color=0000FF]Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace, _
uidoc As NotesUIDocument, _
session As New NotesSession, _
db As NotesDatabase, _
timeView As NotesView, _
timeDoc As NotesDocument, _
emp As Integer, _
i As Integer
Set uidoc = ws.CurrentDocument
Set db = session.CurrentDatabase
Set timeView = db.GetView("(Times)")
' Status "offen" --> "abgeschlossen"
If uidoc.FieldGetText ("Date") = "" Then Exit Sub
If uidoc.FieldGetText ("ID") = "" And _
uidoc.FieldGetText ("name") = "" And _
uidoc.FieldGetText ("prename") = "" Then Exit Sub
If uidoc.EditMode = False Then uidoc.EditMode = True
emp = 0
For i = 1 To 10
' Wenn Feld leer, dann auf 0 setzen
If uidoc.FieldGetText("pers" + Cstr(i)) = "" Then
Call uidoc.FieldSetText("pers" + Cstr(i), "0")
Else
emp = emp + 1
End If
Next
If emp = 0 Then Exit Sub
Set timeDoc = timeView.GetFirstDocument
Do While Not timeDoc Is Nothing
If uidoc.FieldGetText("BER_NR") = timeDoc.GetItemValue("BER_NR")(0) Then
Call timeDoc.ReplaceItemValue("Status", "2")
Call timeDoc.ComputeWithForm(False, False)
Call timeDoc.Save(True, False)
End If
Set timeDoc = timeView.GetNextDocument(timeDoc)
Loop
Call uidoc.FieldSetText ("Status", "2")
Call uidoc.Refresh
Call uidoc.Save
Call uidoc.Document.Save(True,False)
Call uidoc.Close
Call ws.ViewRefresh
End Sub[/color]
Das Problem liegt bei dir in der Zeile:
Call uidoc.Document.Save(True,False)
Warum speicherst du denn hier nochmal dein Backend Dokument ?
In diesem hast du doch gar nichts verändert.
Nimm mal diese Zeile raus dann dürfte es gehen
Immer noch nichts.....
langsam werde ich ein wenig ratlos. Und wenn ich auf dem Speichern Dialog "nein" wähle dann sind die Änderungen trotzdem gespeichert. Na klar.... habe ich ja vorher per script gemacht. Und in den Dokumenteigenschaften (postsave, queryclose, usw.) ist auch nichts drin.
Es ist zum wahnsinnig werden.
Was ist den mit einem uidoc.reload
Ausschnitt aus der Hilfe...
Example
Refreshes the current document with any changes that have been made to the corresponding back-end document. Refreshing the current document updates its representation in memory, as well as visually on the workspace, to reflect the changes that have been made to the back-end document.
Defined in
NotesUIDocument
Syntax
Call notesUIDocument.Reload( )
Usage
This method is valid only when the document is in Edit mode.
Modifications made to non-rich-text items on the back-end document accessed through the Document property appear on the current document immediately. Modifications made to non-rich-text items on the corresponding back-end document accessed from the front-end document but not through the Document property (for example, if you use GetDocumentByUNID) do not appear immediately unless the AutoReload property is True. To cause the modifications to appear when the AutoReload property is False, call Reload or close the document and reopen it.
Modifications made to rich-text items on the back-end document do not appear on the current document until it is closed and reopened.
Modifications made to items on the corresponding back-end document accessed outside the front-end document (for example, by an agent or another user) do not appear unless the document is closed and reopened.
ich werd mal eine Stück-Für-Stück Analyse durchführen. Da uss noch irgendwo was im argen liegen *wühl*
Na endlich.....
Ich habe vor das Call uidoc.close noch folgendes gesetzt und jetzt funktioniert es.
[color=0000CC]Call uidoc.Document.ReplaceItemValue("SaveOptions","0")[/color]
Dann wird er beim nächsten Öffnen aber keine Änderungen mehr abspeichern, sofern du den Wert nicht wieder zurücksetzt.
Was du hier machst ist die Wirkung zu bekämpfen, nicht aber die Ursache zu finden.
Nimm doch mal die Anpassungen an deinem Button Script bis auf die uidoc.Save/close aktion raus und schau ob es dann immer noch passiert
Stimmt nicht... weil den zustand der gespeichert ist diesen wert noch nicht enthällt, und damit beim nächsten öffnen nicht anwesend ist.
Also das wäre für den Formel sprache auch meine lösung gewesen.
taurec: Es ist hier leider nicht den folge der mann hiermit bekämpft sondern wirklich der ursache.. Den Close ereignis schreibt nämlich erneut den letzten bearbeiten ($UpdatedBy) und der verursacht damit den "Dirty" flag der den speichrung verlangt.