So hatte gestern zeit mich nochmals damit zu befassen.
Weiters habe ich diesen Thread entdeckt: http://atnotes.de/index.php/topic,37837.0.html :)
Also für alle die es Interessiert meine HD Anfrage Maske sieht nun bei dem Objekt "Re-Assign Ticket (newDoc) (Aktion) wie folgt aus
Sub Click(Source As Button)
Dim session As New NotesSession
Dim wksp As New notesuiworkspace
Dim db As notesdatabase
Dim uidoc As notesuidocument
Dim doc As NotesDocument
Dim messagestext As String
Dim messagessplit As Variant
Dim messageslist List As String
Dim user As String
Dim x As Variant
Dim i As Integer
Dim message As String
Dim messageintern As String
Dim messagestringsplit As Variant
Dim thisdate As New NotesDateTime("")
Dim ok As Boolean
Dim picklistback As Variant
Dim reroutenewDocumenthistory As String
Dim evalstring As String
Dim evalvar As Variant
Dim isnotesuser As Boolean
Dim notesitem As notesitem
Dim docmailsend As String
Dim Compare1 As String
Dim Compare2 As String
Dim reassignStatus As String
Redim ErrorArray(0) As String
Set db = session.CurrentDatabase
Set uidoc = wksp.CurrentDocument
' if the uidoc is not in editmode set it
If uidoc.EditMode= False Then
uidoc.EditMode=True
End If
' get the actual user
user = session.commonUserName
' build a list for the message strings
messagestext = uidoc.fieldgettext("MESSAGES")
messagessplit = Split(messagestext,";")
For I = 0 To Ubound(messagessplit) Step 1
x = Split(messagessplit(i),"=")
messageslist(x(0)) = x(1)
Next
' get the new supporter via picklist
picklistback = FetchSupporter(Wksp,DB,MessageslistitemNotExists(messageslist, "msgTicketDSelSupporter",2))
If Isempty(picklistback) Then
Exit Sub
End If
' selected a supporter go on and change the document
Evalstring = |@Name([Abbreviate];"| + Picklistback(0) + |")|
Picklistback = CheckAndEvaluate(Evalstring, uidoc.document)
' set some fields in the uidoc
uidoc.Document.supporter = picklistback(0)
Call uidoc.Refresh
'PW PROGRAMMIERT ANFANG
message = MessageslistitemNotExists(messageslist, "msgTicketReAssign",2)
'PW PROGRAMMIERT ENDE
' send the mail either as mail with link or as mail
If Ucase(GetConfigDocByKey ("NoNotification")) <> "YES" Then
' Send Mail with Link
OK = Spoofmessage(_
GetConfigDocByKey("sendMailonBehalfof"),_
picklistback(0), _
"",_
message,_
MessageslistitemNotExists(messageslist, "msgTicketClick",2),_
doc,_
GetConfigDocByKey("MailIfForwardedSubjectFieldName"),_
GetConfigDocByKey("MailIfForwardedBodyFieldName"),_
BoolLink,_
True,_
"BugReport",_
"IsForwardedMailSupporter")
End If
'Call doc.Save(True,False)
' Call uidoc.Reload
' added 12.06.2007 - eknori
' need to close the document after it has been passed to another supporter
Call uidoc.save
Call uidoc.Close(True)
End Sub
Das einzige was mir noch fehlt ist das das e-mail mit Text befüllt wird.
Auch den Subscript Fehler konnte ich beheben. Es lag daran das in der Konfig bei "MailIfForwardedSubjectFieldName" & "MailIfForwardedBodyFieldName" falsche einträge waren, durch mein vieles herumprobieren ;D.
Das einzige was mir noch fehlt ist das das e-mail mit Text befüllt wird.
Auch den Subscript Fehler konnte ich beheben. Es lag daran das in der Konfig bei "MailIfForwardedSubjectFieldName" & "MailIfForwardedBodyFieldName" falsche einträge waren, durch mein vieles herumprobieren Grin.
D.h. aktuell kommt eine Mail mit Betreff, aber der Body ist noch leer?
Ja Betreff und Body sind leer
Also für alle die es Interessiert meine HD Anfrage Maske sieht nun bei dem Objekt "Re-Assign Ticket (newDoc) (Aktion) wie folgt aus
Wo ist die Änderung zum Original?
Nun nach dem Refresh hab ich folgendes reinkopiert (den per Default wird nach dem erstmaligen zuweisen in Status 0 kein mail an den Supporter verschickt)
'PW PROGRAMMIERT ANFANG
message = MessageslistitemNotExists(messageslist, "msgTicketReAssign",2)
'PW PROGRAMMIERT ENDE
' send the mail either as mail with link or as mail
If Ucase(GetConfigDocByKey ("NoNotification")) <> "YES" Then
' Send Mail with Link
OK = Spoofmessage(_
GetConfigDocByKey("sendMailonBehalfof"),_
picklistback(0), _
"",_
message,_
MessageslistitemNotExists(messageslist, "msgTicketClick",2),_
doc,_
GetConfigDocByKey("MailIfForwardedSubjectFieldName"),_
GetConfigDocByKey("MailIfForwardedBodyFieldName"),_
BoolLink,_
True,_
"BugReport",_
"IsForwardedMailSupporter")
End If
Nachtrag:
Hab mittlerweile von der Normalen Re-Assign noch mal einen Teil rüberkompiert, jetzt ist das genau so wie ich mir das vorgestellt hab :)
Anbei noch mal der gesamte Code von Re-Assign Ticket (newDoc)
Sub Click(Source As Button)
Dim session As New NotesSession
Dim wksp As New notesuiworkspace
Dim db As notesdatabase
Dim uidoc As notesuidocument
Dim doc As NotesDocument
Dim messagestext As String
Dim messagessplit As Variant
Dim messageslist List As String
Dim user As String
Dim x As Variant
Dim i As Integer
Dim message As String
Dim messageintern As String
Dim messagestringsplit As Variant
Dim thisdate As New NotesDateTime("")
Dim ok As Boolean
Dim picklistback As Variant
Dim reroutenewDocumenthistory As String
Dim evalstring As String
Dim evalvar As Variant
Dim isnotesuser As Boolean
Dim notesitem As notesitem
Dim docmailsend As String
Dim Compare1 As String
Dim Compare2 As String
Dim reassignStatus As String
Redim ErrorArray(0) As String
Set db = session.CurrentDatabase
Set uidoc = wksp.CurrentDocument
' if the uidoc is not in editmode set it
If uidoc.EditMode= False Then
uidoc.EditMode=True
End If
' get the actual user
user = session.commonUserName
' build a list for the message strings
messagestext = uidoc.fieldgettext("MESSAGES")
messagessplit = Split(messagestext,";")
For I = 0 To Ubound(messagessplit) Step 1
x = Split(messagessplit(i),"=")
messageslist(x(0)) = x(1)
Next
' get the new supporter via picklist
picklistback = FetchSupporter(Wksp,DB,MessageslistitemNotExists(messageslist, "msgTicketDSelSupporter",2))
If Isempty(picklistback) Then
Exit Sub
End If
' selected a supporter go on and change the document
Evalstring = |@Name([Abbreviate];"| + Picklistback(0) + |")|
Picklistback = CheckAndEvaluate(Evalstring, uidoc.document)
' set some fields in the uidoc
uidoc.document.ReroutedBy = user
uidoc.Document.Rerouted = Cstr(Cint(uidoc.Document.rerouted(0)) + 1)
uidoc.Document.Supporter = picklistback(0)
uidoc.Document.DateRerouted = thisdate.LocalTime
uidoc.Document.ReroutedTo = picklistback(0)
Call uidoc.Refresh
Set doc = uidoc.Document
' check if the user is a notes user because only this ones get documents with links
Evalstring = |@unique(@NameLookup ( [Exhaustive]; "| + uidoc.Document.user(0) + |" ;"FullName"))|
EvalVar = CheckAndEvaluate(Evalstring, uidoc.document)
If Isempty(EvalVar) Then
isnotesuser = False
Else
isnotesuser = True
End If
' build the messagestring depending on the defined key
'message = messageslist("msgTicketHint")
'PW PROGRAMMIERT ANFANG
message = MessageslistitemNotExists(messageslist, "msgTicketHint",2)
'PW PROGRAMMIERT ENDE
' check if there is a field that steers mail information sending
If uidoc.Document.HasItem("fldMailIfForwarded") Then
Set notesitem = uidoc.Document.GetFirstItem("fldMailIfForwarded")
If Notesitem.text <> "" Then
docmailsend = notesitem.text
Else
docmailsend = ""
End If
Else
docmailsend = ""
End If
If GetConfigDocByKey("MailIfForwardedLink") = "YES" Then
BoolLink = True
Else
BoolLink = False
End If
' Build the message for the new supporter
' build the messagestring depending on the defined key
'message = messageslist("msgTicketReAssign")
'PW PROGRAMMIERT ANFANG
message = MessageslistitemNotExists(messageslist, "msgTicketReAssign",2)
'PW PROGRAMMIERT ENDE
' send the mail either as mail with link or as mail
If Ucase(GetConfigDocByKey ("NoNotification")) <> "YES" Then
' Send Mail with Link
OK = Spoofmessage(_
GetConfigDocByKey("sendMailonBehalfof"),_
picklistback(0), _
"",_
message,_
MessageslistitemNotExists(messageslist, "msgTicketClick",2),_
doc,_
GetConfigDocByKey("MailIfForwardedSubjectFieldName"),_
GetConfigDocByKey("MailIfForwardedBodyFieldName"),_
BoolLink,_
True,_
"BugReport",_
"IsForwardedMailSupporter")
End If
'Call doc.Save(True,False)
' Call uidoc.Reload
' added 12.06.2007 - eknori
' need to close the document after it has been passed to another supporter
Call uidoc.save
Call uidoc.Close(True)
End Sub