Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: Alexis am 13.06.06 - 13:32:39

Titel: Mail.send mit doppelter Abfrage
Beitrag von: Alexis am 13.06.06 - 13:32:39
Hallo Forum,

ich bin mal wieder ratlos:

in einem Response-Dokument im Editmode versende ich eine Mail mit einem Standardtext. Dabei erscheint dann das Standardfenster zum Versenden der Mail, dieses jedoch doppelt (siehe Bild)! Klicke ich 2 mal auf Send stürtzt LN ab. Wo liegt der Hase im Pfeffer?

Hier der relevante Code:
Code
Dim session As New NotesSession
	Dim db As NotesDatabase
	Set db = session.Currentdatabase
	Dim uiws As New NotesUIWorkspace
	Dim uidoc As NotesUIDocument   
	Dim maildb As NotesDatabase
	Dim maildoc As NotesDocument
	Dim profil As NotesDocument
	Dim parentdoc As NotesDocument
	Dim thisdoc As NotesDocument 
	Dim doc As NotesDocument
	Dim rtitem As Variant
	Dim uiview As NotesUIView
	
	Set uidoc = uiws.CurrentDocument
	Set thisdoc = uidoc.Document
	thisdoc.Form = "AI"
	creator = thisdoc.GetFirstItem("Createdby" ).text
	action = thisdoc.GetFirstItem("Action").text
	If action = "" Then 
		Dim askme As Integer
		askme = uiws.Prompt( PROMPT_OK, "Fault!", "You must enter an Action proir to sending the mail")
		'Messagebox "You must enter an Action proir to sending the mail"
		Exit Sub
	Else
		Call thisdoc.Save(True,False)
	End If

	' Mail to specialist #####################################################################

	Set maildb = New NotesDatabase("","")
	maildb.OpenMail
	Set profil = maildb.GetProfileDocument("CalendarProfile")
	Set maildoc = New NotesDocument(maildb)
	maildoc.Form = "Memo"
	maildoc.Logo = profil.DefaultLogo(0)
	maildoc.Principal = profil.Owner(0)
	maildoc.SendTo =  thisdoc.AssignedTo(0)
	maildoc.Subject = "An Action Item has been assigned to you from the Support Line Tool"
	Set rtitem= maildoc.GetFirstItem( "Body" )
	If rtitem Is Nothing Then
		Set rtitem = New NotesRichTextItem( maildoc, "Body" )
	End If
	Set rtitem = maildoc.GetFirstItem( "Body" )
	Call rtitem.AppendText( "This Action Item has been assigned to you from the Support Line Tool")
	Call rtitem.AddNewLine( 2 )
	……………………..
	Call rtitem.AppendText( "Best regards")
	Call rtitem.AddNewLine( 1 )
	Call rtitem.AppendText( Creator)
	Call maildoc.Send(False)

	‘ Mail to specialist ######################################################################

	Call uiws.EditDocument(True, maildoc)
	Set uidoc = uiws.CurrentDocument
	Call uidoc.Save
	Call uidoc.Close
	Call thisdoc.Save(True,False)
End Sub
Titel: Re: Mail.send mit doppelter Abfrage
Beitrag von: Lossa am 13.06.06 - 14:00:50
Hallo,

kann es sein, das die Maske des geöffneten Dokumentes die Eigenschaft hat, senden beim schliessen aktiviert hat? Findest du in der Maskeneigenschaft auf dem 2. Reiter.

Ansonsten warum speicherst du das ui-document und das backend-dokument? Entweder du speicherst im FrontEnd oder via Backend.


Titel: Re: Mail.send mit doppelter Abfrage
Beitrag von: Alexis am 13.06.06 - 14:16:49
Hallo Ulrich-Thomas,

Häkchen für "Present Mail Send Dialog" ist nicht gesetzt!

Zu Deiner Anmerkung: Ist noch ein Relikt aus einem Set DokLink im Backend.

Alexis
Titel: Re: Mail.send mit doppelter Abfrage
Beitrag von: Lossa am 13.06.06 - 14:19:55
Hallo,

dann schmeiss einmal den Rest hier raus:

Zitat
Call uiws.EditDocument(True, maildoc)
Set uidoc = uiws.CurrentDocument
Call uidoc.Save
Call uidoc.Close
Call thisdoc.Save(True,False)
End Sub
Titel: Re: Mail.send mit doppelter Abfrage
Beitrag von: Alexis am 13.06.06 - 15:11:31
Des Rätsels Lösung:

Im aufrufenden Button für das mail.send stand folgender Code:

@Command([RunAgent];"MailToSpecialist");
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow])

Mit Entfernen der letzten beiden Zeilen klappt es nun.

@ Ulrich-Thomas,
Danke für den Hinweis, werde auch das korrigieren.

Alexis