Processing Documents in a View Template

In a view on the web, I would like to do the following two things:

A) Process selected documents in a view.

B) In the view, display a pop-up window with a dialog box. Copy the selections from the dialog box to selected documents in the view.

For item A, I’ve been able to apply the solution described at http://www.codestore.net/store.nsf/unid/EPSD-5GMT3B?OpenDocument

Item B presents a problem however. To explain why, I need to first describe the components used in item A which are as follows:

  1. ‘Document’ form - creates docs to be processed.

  2. ‘Processor’ form - a response to Document.

  3. ‘$$ViewTemplate’ - identifies selected documents.

The Processor is appended to the template (similar to how responses are appended on this forum). The template contains buttons that run a function in its JS Header to update the selected Document and submit the Processor. The Processor is not saved (its SaveOptions=“0”) although its WebQuerySave is invoked - this runs an agent which includes the following code:

Dim context as NotesDocument

Dim processDoc as NotesDocument

Set context = session.DocumentContext

Set item = context.GetFirstItem(“processdocs”)

Forall v in item.values

Set processDoc = db.GetDocumentByUNID( v )

’ < do processing of selected documents>

End Forall

In this code, ‘processdocs’ is a field on Processor that contains the URL’s of the selected documents. The enables the agent to locate and process each selected document.

The problem is this - in item B, a selection in the dialog box of the child window is returned to a field on the template (the parent). When the agent runs, it uses ‘Session.DocumentContext’ to refer to Processor but it does not have a reference to the template. It therefore does not seem as if the agent can apply the selected value from the dialog box which is in a field on the template to any of the selected documents.

I’d appreciate any suggestions on how the template might be referenced by the agent so that the template field containing the value of the dialog box selection can be used to update the selected documents.

Thanks.

Subject: Processing Documents in a View Template

Jeez, if you’d explained it that way the first time instead of insisting that you wanted to save a view template, you might have gotten somewhere. Put the field you want to reference in the same HTML form as the document selection checkbox (it MUST be within the same tagset in order to be submitted), the make sure that the field also appears on the Designer form that you are submitting the process request to (otherwise it will either be discarded or cause an error when the submission is married to the Designer form prior to the web query save).