Invoke agent from within another agent

Is it possible to invoke an agent in my mail-db when some event occursin my address book and how do I do it then ?

What I want to do, is to automate the “Actions → Synchronize Address book” action.

To do that, I want to write an agent that is invoked each time a document has changed in my addressbook.

Then that agent should call the “Synchronize Address Book” agent in my mail database

(“Synchronize Address Book” agent is the one that is invoked with “Actions → Synchronize Address book”)

Guy

Subject: invoke agent from within another agent

It may be a bit crude, but in the script lib. there is a call in the function iNotes_DoSync to the final display …

Call iN_ShowResults()

Comment it out and set the agent to run schedule. Of course if there is an error…

Subject: invoke agent from within another agent

You’d have to edit the query save and/or post save events on the Person form on the personal address book. You’d have to use the run method in the NotesAgent lotusscript class, but I think it would be more trouble than it’s worth, and a bit of an overkill.

You’d probably have better luck making a copy of the Synchronize Address Book agent and setting it to run on a schedule. Even then, you’d have to go through the script library it uses (perhaps making a new copy of that as well) and remove all UI class references (namely the part that calls the messagebox telling you the agent succeeded). Otherwise it will yield an error when it runs.

Subject: RE: invoke agent from within another agent

Well, maybe that’s indeed a better solution.

Actually my first thought was to place a (modified) copy of the original agent

(and script) in my addressbook and have that executed on the “document change” event.

But for that to work, I have to edit the script library.

So I started modifying it (calling the right database and thing like that) but after some modifications I am stuck.

I get an error in iN_GetServerTimeDiff, more specifically on this line:

Set doc = g_db_m.GetProfileDocument(D_IN_PROFILE)

Not sure what this line does/should do in order to get the synchronization to work,

but for this I am probably not in the right Forum ?

Anyway, because of that I was thinking to just run the original agent when needed, but the

defficulty then is - at least for me - I have to create an agent on

my address book that calls the original agent

Maybe I’ll just try to find some help on getting the error fixed in the script

and getting the agent run or - as you suggested - just run

the original agent on a schedule

Guy