.comment-link {margin-left:.6em;}
This Blog has moved to http://www.falsepositives.com/

False Positives Adventures in Technology, SciFi and Culture from Toronto

Wednesday, October 20, 2004

Run a Lotus Notes Domino Web agent via Javascipt

When coding on some Domino web app, I frequently need to do more than just a WebQuerySave. I could use a Formula code "@URLOpen()", but for actions that are really serious it nice to confirm that they really, really, meant to push that button before you launch the nuclear missiles....., and that’s hard to do on the web without a little JavaScript...so this is the sort of code I add to the button or hotspot.:


// this code could be in your JS header or Js include file.
path = window.location.pathname.toLowerCase();
nsfPos = path.indexOf(".nsf");
path = path.substring(0, nsfPos+5);
// path now contains the relative url of the window upto ".nsf/"

if ( confirm('Please confirm this very dangerous Action.') )
{
f = document.forms[0];
action = path + "YourAngentsName?OpenAgent";
window.location.replace(action);
}


After the "?OpenAgent" you can pass paraments of course, which then needs to be parsed out. This whole technique lends itself very nicely to the proper way to Delete Domino Doc on the web

I'm not sure if I "borrowed" this for someone else years ago or invented myself. Part of the reason for posting this is so I don't forget it.

Also Search Domino posted a similar tip to fill a more complicated need, from which I'm sure I can learn a few tricks.

Category:Domino


Please Note that this Blog (False Positives) has moved to http://www.falsepositives.com/

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home