_________________ _________________ $$ViewTemplate: _________________ Paste the functions needed for actions in the JSHeader: (these are named the same as the Lotus ones just with the form names updated) function _SelectMarkForDelete(){ var form = document.ApDocs; for (var i = 0; i < form.elements.length; i++) { if (form.elements[i].type == "checkbox") { if (form.elements[i].name == "$$SelectDoc") { if (form.elements[i].checked) { var theImg = eval("document._SelectImg" + form.elements[i].value); if (theImg.src.indexOf("httrash.gif") != -1) theImg.src = "/icons/ecblank.gif"; else theImg.src = "/icons/httrash.gif"; form.elements[i].checked = false; } } } } } function _SelectDelete(){ var form = document.ApDocs; for (var i = 0; i < form.elements.length; i++) { if (form.elements[i].type == "checkbox") { if (form.elements[i].name == "$$SelectDoc") { var theImg = eval("document._SelectImg" + form.elements[i].value); if (theImg == null) continue; if (theImg.src.indexOf("httrash.gif") != -1) { form.elements[i].checked = true; theImg.src = "/icons/ecblank.gif"; } else { form.elements[i].checked = false; } } } } } function _SelectAllDocs(select){ var form = document.ApDocs; for (var i = 0; i < form.elements.length; i++) { if (form.elements[i].type == "checkbox") { if (form.elements[i].name == "$$SelectDoc") { form.elements[i].checked = select; } } } } _________________ Above the embedded view, add this code to end the default form and start our custom one:
_________________ Next add these actions (chose Javascript type) with the following code: Select All: _SelectAllDocs(true); return false; Deselect All: _SelectAllDocs(false); return false; Approve: var frm = document.ApDocs; frm.submit(); At the bottom of the template form, end the custom form we've begun: (Note: This may not be needed, look at your view source to see if Domino inserts one automatically for you.)
_________________ _________________ View Embedded in View Template: _________________ Add a collumn with the following formula: "[]" _________________ _________________ Temporary Form: _________________ - Name form to match post name in view hack code above add SaveOptions field (CWC) with value "0" to prevent doc from saving add DBPath field (CFD) with formula: db:=@Subset(@DbName; -1); @ReplaceSubstring(@ReplaceSubstring(db; "\\"; "/"); " "; "+"); add webquerysave event agent call. _________________ _________________ Agent to Process Selected Docs: _________________ - Name agent name in webquerysave of temporary form above Sub Initialize ' this agent processes the list of documents selected in the WebOrdersPending view. ' the view has a hacked form that loads a dummy doc "ApprTmp", that then calls this agent via the webquerysave Dim session As New NotesSession Dim db As NotesDatabase ' this db Dim view As NotesView ' the approver pending view - needed only to do a view refresh Dim tmpDoc As NotesDocument ' current tmpdoc ApprTmp Dim doc As NotesDocument Dim item As NotesItem Dim value As String On Error Goto ErrorHandler On Error 4091 Goto ErrorHandler4091 Set db = session.CurrentDatabase Set view = db.GetView("WebOrdersPending") Set tmpDoc = session.DocumentContext Set item = tmpDoc.GetFirstItem("$$SelectDoc") ' update the docs Forall v In item.Values Set doc = db.GetDocumentByUNID( v ) If Not (doc Is Nothing) Then doc.Status = value Call doc.Save( True, True) End If End Forall Call view.Refresh Print "[" & tmpDoc.DbPath(0) & "/WebOrdersPending!OpenView]" Exit Sub ErrorHandler: Print "
" & "Info: " & Str(Err) & ": " & Error$ & " on line: " & Cstr(Erl) Exit Sub ErrorHandler4091: Print "[" & tmpDoc.DbPath(0) & "/WebOrdersPending!OpenView]" Exit Sub End Sub