|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tips and tricks in LotusScript (continued)
But if it isn't, some way of starting the agent on the server would be neat. And that's where NotesAgent.RunOnServer comes in.
All I did was create a new agent in my database, as below:
Sub Initialize
Dim sess As New NotesSession
Dim db As NotesDatabase
Dim agent As NotesAgent
Set db = sess.CurrentDatabase
Set agent = db.GetAgent("GetInfo")
flag = Messagebox(_
"This will run the extract agent on the server where the DB2 client enabler is installed. It takes a few minutes to run. Do you want to continue?",20,"Execution Check")
If flag = 6 Then
Call agent.RunOnServer
End If
End Sub
|
And with this agent available as an Action Menu agent, I could start the backend agent running any time I liked, at the expense that my client waits for the server agent to finish. Pressing Ctrl-Break stops the server agent, so I could let it run a few seconds, stop it, and then inspect the database for results. It sure beats walking across to the server to run it.
Domino Designer 6 gives me a couple of extra useful tools. I can run the agent in a Background Client Thread by selecting the property shown in Figure A.
FIGURE A
 
Check here to run Agents in the background on the Notes 6 Client. Roll over picture for a larger image.
If you do this, then when you save it you are warned that the agent must not do any client interactions or any UI work, because if it does, an error will occur. Secondly, I should be able to use the Remote Debugger to debug the server agent. I have to say that at this point that I have not actually tried to use this from a NotesAgent.RunOnServer, but I think it should work.
So there we are. A few new tricks, but actually most of what I learned about programming all those years back still holds.
Product availability and resources For the article, "Doing more in LotusScript with Notes.Net class libraries," by Mick Moignard in the October 2001 issue of DominoPower, visit http://www.dominopower.com/issues/issue200110/script001.html.
Easy, flexible article reprints ZATZ now offers a quick, easy, flexible and inexpensive way to use article reprints in your marketing and promotion efforts. You can now get article reprints for a one-time fee of only $200. For details, visit http://mediakit.zatz.com/reprints.
|
Philippe Schlier worked on messaging projects for over 17 years, on Notes since V2. In 1995, he founded GSX, publisher of GSX Monitor, the most successful monitoring product for Domino, Exchange, BlackBerry and Sametime. While at GSX, he designed their flagship monitoring product, which is now used by 500+ clients worldwide. This allowed him to dive quite in-depth within the architecture of the various messaging and collaboration platforms, to share ideas and work with developers and designers from biggest software players, like (Iris/Lotus/IBM, RIM, Nokia, and Microsoft). Philippe is based in Switzerland and work now for Avonik, as independent contractor on software architecture, design and quality assurance. You can read his blog at http://avonik.com/blog.nsf and contact him via email at pschlier@avonik.com.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.
Register by April 10 to save $200. |
|
|
|
|
|
|
|
|
|
|