Notes Tips - Tip #1

When I first started doing Lotus Notes/Domino I created a database to capture all of my “Notes On Notes”… Basically Hints, Tips and things I learned or crafted that would help me out in future projects. So with that said, here is Tip #1.
Call an Agent Using Javascript Passing Parameters 1) Create a COMPUTED TEXT field called DBServerPath and add the following code to the value:
"/" + @ReplaceSubstring(@Subset(@DbName;-1);"\\";"/")2) In the onClick event of your button add the following Javascript Code (substitute “AgentName” for the name of the agent you wish to run):
var dBPath = document.forms[0].DBServerPath.value
location.href = dBPath + “/AgentName?OpenAgent&Parameter=WhateverHere”NOTE: that in the agent the context is not the document that called the javascript but the agent itself so you cannot access the DocumentContext.