Danke m3, das hat schon viel geholfen!!
Ich hab es ein wenig anders gemacht als im Sample, da ich den Agenten über Web starte, was auch einwandfrei funktioniert.
Allerdings hab ich jetzt Probleme das Feld im Agenten auszulesen. Irgendwie is das immer leer und beim Split haut es ihn dann auf.
Das is der Button in $$ViewTemplateDefault
<input type="button" class="formAction" value="StdComment" target="_blank" onClick="InsertStandardComment()">
Hier der Javascript Teil der bei onClick aufgerufen wird.
TempString is ein verstecktes Feld das Text/Berechnet ist.
| function InsertStandardComment(){ |
| |
| var url = window.document.getElementById("dbPath").value + "/InsertComment?openagent"; |
| var urlReturn = window.document.getElementById("Path_Translated").value + "/?OpenForm"; |
| if (window.document.applets[0]){ |
| window.document.getElementById("tempString").value = window.document.applets[0].getSelectedDocumentsEx(); |
| Check = confirm("You have selected " + window.document.getElementById("tempString").value.split(",").length + " document(s) for StandardComemnt, do you really want to continue?"); |
| if (Check){ |
| alert(window.document.getElementById("tempString").value); |
| window.document.forms[0].submit(); |
| window.location=url; |
| |
| } |
| } |
| } |
Und hier der Agent:
| Sub Initialize |
| |
| Dim s As New NotesSession |
| Dim db As NotesDatabase |
| Dim doc As NotesDocument |
| Dim ermComment As String |
| Dim trmComment As String |
| Dim docArray As Variant |
| |
| On Error Goto errHandle |
| |
| Set db = s.CurrentDatabase |
| |
| ermComment = "ermcomment" |
| trmComment = "trmcomment" |
| |
| ' Set Comment for selected Docs |
| docArray = Split(viewDoc.tempString(0), ",") |
| |
| Forall unid In docArray |
| Set doc = db.GetDocumentByUNID(unid) |
| |
| If(doc.ErmTrmFlag(0) = "TRM") Then |
| doc.trmComment(0) = trmComment |
| Else |
| doc.ermComment(0) = ermComment |
| End If |
| |
| Call doc.Save( False, True ) |
| |
| End Forall |
| |
| Exit Sub |
| |
| errHandle: |
| Exit Sub |
| |
| End Sub |
Ich glaub das das mit dem Speichern des $$ViewTemplateDefault irgendwie nicht richtig hinhaut???
Danke vielmals
Alex
Edit: Ach ja - hatte ich vergessen - im OnSubmit dieser Maske hab ich noch @Command([FileSave]) drinnen