Manage Learn to apply best practices and optimize your operations.

Get A Handle On Selected Documents Within An Embedded View

Wouldn't it be nice if you could act on selected documents within a forms
embedded view on the web? Here's how I've done it.
First create a button with the following JavaScript on the form with the
embedded view:

// Create a regular expression to retrieve the hostname
// and database from the url
var expPattern = /(.+nsf)./;
var aMatch = location.href.match(expPattern);

if (aMatch != null) {
// Get a handle to the view applet
applView = document.applets.view;

if (applView != null) {
// Wait for the view applet to initialize
while (!applView.isActive()) {};

// Get the view UNID of the currently opened view
var sViewUNID = applView.getViewName();

// Get the document UNID of the currently selected documents
var sDocUNID = applView.getSelectedDocumentsEX();
var sOpenURL
" +sDocUNID+"ActionField=Free%ActionValue=1%"+"View="+sViewUNID+"%";
window.location= (sOpenURL);

What this does is pass a list of all of the selected documents UID's in the
embedded view to the agent which you can then parse out using the
doc.Query_String. I am also passing the view unid in the url, since my use was
to return to a $$ViewTemplate form, however; you can omit this or pass a form

After you process your documents form there uid's in you scripted agent, you
can than print to the original url i.e. Print

this will reload the form with the embedded view, and thus refresh the embedded

The embedded view is a great tool, but is even better when you can access and
process documents within the view, from the back end. I hope someone is able to
use this, it's been very useful for me.

Dig Deeper on Domino Resources - Part 7

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...