Refresh uidoc when delete in embedded view

Hi

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!

Any help yould be appreciated ;o)

Ursus

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

thank you for answering ;o)

Yeah, I know about the PostDocumentDelete but it is never called in my database - did try it.

Will see why it is not called - maybe I can find some problem - soft-deletes are not currently on…

The problem with the PostDocumentDelete is that it is called every time something is deleted in the database - not really what I want!

I could just delete using a button - but that seems a little contrived!

Anyway… any other takers

Ursus

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

Hi again ;o)

nope - am still having problems with PostDocumentDelete not running - even with a @StatusBar and nothing else :o(

Am using R6.5 so I shouldn’t be having any problems with Database Script not running - thanks for the pointer though ;o)

Yip - you are right that it should be easy with a select case ;o)

Thank you for your help

Ursus

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.

Cheers,

G