BUG? Embedded View & UIDoc.EditMode Manipulation

I think I’ve discovered a bug. I have an embedded view in a document. The embedded view contains documents that are response documents to the current parent document. If the user opens up a document from the embedded view, I want the parent doc to be taken out of edit mode.

I added the following script to the QueryOpenDocument event on the embedded view:

//

Dim workspace As NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set workspace = New NotesUIWorkspace

Set uidoc = workspace.currentDocument

uidoc.EditMode = False

//

When I open up a document in the embedded view (with the parent document in Edit Mode) I get a NSD pop-up and my clients shut down. The EditMode property is definitely available (replacing “uidoc.EditMode = False” with “Messagebox uidoc.EditMode” works fine).

Has anyone else seen this? I’d like to be able to kick the parent document out of edit mode so that I don’t create a Save/Replication conflict in the parent document if changes in the child are pushed back up to the parent in the back end.

TIA,

Scott

Subject: BUG? Embedded View & UIDoc.EditMode Manipulation

Scott, I know that this is much too late to be very useful to you, but I thought it might help someone else coming across this same problem. I’ve been running into a similar problem, except that I’m trying to put my parent document (the document in which the view is embedded) into edit mode. I want to do this so that I can update the parent with a value, refresh the parent, so that some computed fields are updated, then save the parent with a uidoc.Save. I have all of the code for doing this working fine in a small test database I used for prototyping and developing my solution. When I copied this code over to our development database for the application I want to use this code with, and now it causes my Notes Client to NSD. We’re on 6.5.3. It’s really bizarre. When I comment out the “uidoc.EditMode = True” the code runs fine (as long as I manually put the parent document in edit mode first).

I found this technote which may be related in the IBM KB (Reference #: 1085799) :

http://www-1.ibm.com/support/docview.wss?rs=475&context=SSKTWP&q1=NEMMainLoop&uid=swg21085799&loc=en_US&cs=utf-8&lang=en

When I looked at my NSD crash stack, there were a lot of similarities to the crash stack in that technote.

Subject: BUG? Embedded View & UIDoc.EditMode Manipulation

The simple answer might be to to not allow the embedded view to display only when the document is in read mode.

The edit mode property is NOT available because you no longer have focus on the parent document.

The other options would be creative use of the SaveOptions field…

Subject: RE: BUG? Embedded View & UIDoc.EditMode Manipulation

Actually, I DO have access to the parent document at that point. A simple test proves this true. If I place this code in the QueryDocumentOpen event of the embedded view, it gives me the proper DocID (where DocID is a Computed When Composed field containing @Text(@DocumentUniqueID)) from the document that contains the embedded view.

The code I used was:

//

Dim workspace As NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set workspace = New NotesUIWorkspace

Set uidoc = workspace.currentDocument

Messagebox uidoc.FieldGetText(“DocID”)

//

So, I DO have access to the parent document at that point (maybe b/c it’s QueryOpenDocument & is before the selected record is opened?). In any case – any additional thoughts in light of this?

TIA,

s

Subject: RE: BUG? Embedded View & UIDoc.EditMode Manipulation

I will have to ponder this. This might be what is causing the problem as Notes is choking on itslef as you are trying to navigate between documents while the mode is switching…

Is there a reason why the document needs to be in editmode to begin with for them to open one of the embedded documents?