Domino 9 und frühere Versionen > Entwicklung

Mail Forward Agent

<< < (2/2)

zhermann:
Hi,

wie kann ich aber dann den Agenten dazu bringen das zu machen was er soll.

Mein Problem ist halt, das ich erst prüfen muß, ob der Absender in der Lsite ist, wenn nicht, darf das Mail nicht weitergeschickt werden. Wenn ja soll es verteilt werden.

DocumentContext ist aber eine Backend Klasse und sollte im hintergrund laufen???

Gibt es ein Tool was meine Anforderungen erfüllt??


Gruß Zsolt Hermann

ata:
Hoy...

... hier ein Auszug aus der Hilfe von Notes:

For an agent activated in a view through the Notes client UI, the in-memory document is the document highlighted in the view.

For an agent run from a browser with the OpenAgent URL command, the in-memory document is a new document containing an item for each CGI (Common Gateway Interface) variable supported by Domino. Each item has the name and current value of a supported CGI variable. (No design work on your part is needed; the CGI variables are available automatically.)

For an agent run from a browser with @Command[ToolsRunMacro], the in-memory document is the current document. In the case of WebQueryOpen, this is the document before Domino converts it to HTML and sends it to the browser; in the case of WebQuerySave, this is the document before Domino saves it. If the form on which the document is based contains a field named the same as a Domino-supported CGI variable, the in-memory document also contains the value of that variable. (You must explicitly design the CGI variables into the form, for example, as hidden fields.)

... soviel zum DocumentContext...

... ich würde es mit einem zeitgesteuerten Agent probieren - zum Bsp. stündlich überprüfen, was in der letzten Stunde eingegangen ist, die Docs in eine Collection ziehen und dann abarbeiten...

ata

zhermann:
Hi,

jetzt versuche ich es mit der Zeitsteuerung, aber diese funktioniert nicht.

Hier mal der Code den ich im Agent verwende:

Sub Initialize
   
   Dim sess As New NotesSession
   Dim Db As NotesDatabase
   
   Dim Mail_In_Doc As NotesDocument
   Dim Mail_out_Doc As NotesDocument
   Dim ConfigDoc As NotesDocument
   Dim Item As NotesItem
   
   Dim MailFrom As String
   Dim MailList As Variant
   
   Set db = sess.CurrentDatabase
   
   Set ConfigDoc = db.GetProfiledocument("(UserGroupList)" )
   
   Set Mail_In_doc = sess.DocumentContext
   
   MailFrom = Ucase( Mail_in_Doc.GetItemValue("SMTPOriginator") (0))
   
   If Not(ConfigDoc Is Nothing) Then
      
      MailList = Ucase(ConfigDoc.GetItemValue("Userlist") (0))
      If Instr(1,  MailList, MailFrom) Then
         
         Set Mail_out_Doc = New NotesDocument(DB)
         Set Item = Mail_In_Doc.GetFirstItem("Body")
         
         With Mail_Out_Doc
            .Form = "Memo"
            .Subject = Mail_In_Doc.GetItemValue("Subject") (0)
            
            Call Item.CopyItemToDocument(Mail_out_doc, "")
            .Principal = "Usergroup@lstelcom.com")
            Call .send( False,  "&Usergroup")
         End With
         
      End If
      
   End If
   
End Sub

Wenn ich den Agenten per Hand ( Button) aufrufe, funktioniert es mit der Einschränkung, daß kein Absender angegeben ist.

Hat jemand von Euch den Durchblick ?

Danke Zsolt Hermann

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln