I am looking to build some workflow tracking into a mail database, specifically to log when a document is moved to any folder (to capture what folder it has been filed into, when, and by who).
We’ve been able to implement a partial solution by adding some code to the Queryaddtofolder event of all the folders in the DB. This code works when you drag and drop a document, and when you use the Folder\Move to Folder action from the view.
However, it DOESN’T work when you are actually in the document, and use the Folder\Move to Folder action in the memo form. I’m guessing that the Queryaddtofolder event is not being triggered because we are not at the view level.
I’ve tried to write some different code to replace the Folder\Move to Folder action button in the form, that uses the following logic:
1 - get a list of the existing folders that the document is in, using NotesDocument.FolderReferences
2 - show the folder dialog, using NotesUIWorkspace.Folder
3 - get a second list of the folders that the document is in, using the same method as step 1
4 - compare the results of steps 1 and 3, and evaluate the from/to folders based on what has changed
5 - populate the workflow fields
However, the folder references in step 3 are not being updated while the document is still open.
Does anyone have any suggestions about how I can capture the source and destination folders when filing a document from within the document? Is there an event that will ALWAYS be triggered when filing a document, regardless of whether you are in a view or in the document itself?