Mark XY Brown 1.Nov.12 01:14 PM a Web browser Domino Designer 6.0.3 Windows XP
Got another frustration here.
The Powers That Be like having a Notes database to handle the invitations to the Christmas party each year. Each year, the databases need more and more features. My problem this year is to create an action against an Invitee document that will allow the organisers to manually send an invitation to a latecomer.
The database has a number of forms. The ones impacted here are:
Invitee (Name and address of invitee, as well as their internal/external flag, and Invited, Responded and Attending flags)
OGM (Message title, invitation flag, whether this message is destined for internal or external invitees, message fields)
As it takes fields from two documents to compose a message, I set up an action on the Invitee form and an agent.
The action prompts the organiser for a message (workspace pick list, source view categorised on the invitee's internal/external status), and then dumps the message's UNID and the invitee's UNID into a temporary document. It passes the note ID of the temporary document to the agent.
The agent calls back the temporary document and then interrogates it for the UNIDs of the other two documents. Then it analyses the values in them and composes an invitation accordingly. It sends and then purges the invitation, and deletes the temporary document.
The action, meanwhile, has been polling the database for the temporary document. As soon as it's not found, it alerts the organiser that the invitation has been sent.
Well, that was the plan. If I step through the code, I can generate a temporary document. I can then manually call back that document in the agent, and the code all runs as I expect. If I try letting it run normally, the action generates an endless loop.
Sub Click(Source As Button)
'Pass parameters to the (ManualSend) agent to invite this person
Dim ws As New NotesUIWorkspace
Dim sess As New NotesSession
Dim db As NotesDatabase
Dim agnSend As NotesAgent
Dim namServer As NotesName
Dim docThis As NotesDocument
Dim docParam As NotesDocument
Dim strServer As String
Dim strFile As String
Dim strInt As String
Dim varOGMID As Variant
Dim strOGMID As String
Dim strInvID As String
Dim strParam As String
Set db = sess.CurrentDatabase
Set docThis = ws.CurrentDocument.Document
Set agnSend = db.GetAgent("(ManualSend)")
Set docParam = New NotesDocument(db)
Set namServer = New NotesName(db.Server)
strServer = namServer.Common