Notes 6 introduced the ability to run an agent in a background thread. You enable this behavior by checking the
Run in background client thread property in the Agent Properties dialog box:
Since no good deed in Lotus Notes goes unpunished, Domino Designer displays the following message box every time you save the agent:
As a result, users can run this agent in a background thread
if the agent the agent is executed from the Notes Actions menu:
or using the following formula code:
@Command ( [ToolsRunMacro]; "Run me in the background, baby!" )
What if you want to trigger the same agent via LotusScript? Unfortunately, LotusScript will not run an agent in the background, regardless of whether the above agent property is checked.
However, you can hack your way around this limitation by having your LotusScript code open a form in the Notes UI that executes the above @Command in the Postopen event. Provided that your LotusScript to opens and closes the NotesUIDocument immediately, users will never know what's happening.
All credit for this nifty trick goes to Chhanno L Verma, who
answered his own
question in the Notes/Domino 6 and 7 Forum.