I have a document that contains an embeded view (single category using UID of UIDoc). I have an action button that adds documents to the view. I have a field on my document that keeps track of the number of documents that are in the embeded view - when I have added documents using my button I do a UIDoc.Refresh and this triggers my routine that updates the doc count on the UIDoc. When the user deletes a document in the embedded view and presses F9 I do not get informed of it in my UIDoc and cannot therefore update the document count.
I have found a few references to this problem here in the forum but nobody answered the “delete” problem.
No event gets triggered in the view (so that I could use workspace.currrentdocument.refresh) AFTER the delete of the document - I do get a QueryDocumentDelete event but that is BEFORE the document is deleteted!
Subject: refresh uidoc when delete in embedded view
There’s actually a PostDocumentDelete event which can be found in the database script under “Other” - “Database Resources”.
A word of warning - what you are trying to do may cause you problems. I tried the same thing and when I got the code to run the refresh when a document was deleted, I continually got the red screen of death and my client crashed. I was able to reproduce this problem with 6.0.2CF1 and 6.0.2CF2. Just in case you experience the same. Not certain if Lotus have got around to fixing this yet…
Subject: RE: refresh uidoc when delete in embedded view
Hi Ursus,
PostDocumentDelete should run each time - however, you may find that if you’re debugging it it appears as if nothing happens - this is due to a bug with early versions of 6 and the debugger not running with database script events.
Also, I realise that PostDocumentDelete is run every time something is deleted, but surely this would be easy to customise and perform different actions, say using a select case on document form or something similar…
Subject: RE: refresh uidoc when delete in embedded view
Ursus,
You might want to flag this as a bug to Lotus. I’ve already come across two or three things which are to be released in 6.0.4, and seeing that 6.5 and 6.0.x code streams are being developed simultaneously, it wouldn’t surprise me if the same bugs were present in both releases.