uidoc not reloading

Posted on 2007-03-29
Last Modified: 2013-12-18
I have a document with responses displayed in an embedded view.

Actions taken on a response update the status and contents of the log in the parent document.

If I call an action in the parent document which modifies data and saves, before calling an action in the response, the parent status and log are updated (reloaded) when I close the response doc...

However when I open a response, without doing anything to the parent, the status and log aren;'t updated..

Is there a way to avoid this?

uidoc.autreload=true didn't solve the prob..
there are quite a few computed fields but none of them make any changes.. computing their own value

Question by:miklesw
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +2
LVL 19

Expert Comment

ID: 18814256
You need to place your code. Else we don't know how you are accessing parent document.
Use below code to access Parent doc.
Function GetParentDocument( doc As NotesDocument )
      Dim db As NotesDatabase
      Dim parentDoc As NotesDocument
      Set db = doc.ParentDatabase
      If doc.IsResponse Then
            Set parentDoc = db.GetDocumentByUNID _
            ( doc.ParentDocumentUNID )
      End If
      Set GetParentDocument = parentDoc
End Function

Author Comment

ID: 18814297
      Set docFile = db.GetDocumentByUNID(AuditFileUNID)
      If docFile Is Nothing Then
          Msgbox "Failed to open Audit File Document!!!" ,48,"Accept Retrieval Request"
          Exit Sub
      End If
      docFile.TransactionHistory =Split(Join(docFile.TransactionHistory,";")& ";" & Now & " - " ....
      Call docFile.ComputeWithForm(False,False)
      Call docFile.Save(True,False,False)
      Call uidoc.FieldSetText("ReturnedBy", sess.UserName)
      Call uidoc.FieldSetText("DateReturned",Cstr(Now))
      Call uidoc.FieldSetText("RequestStatus","Returned")
                     Call uidoc.Close(True)            
LVL 63

Expert Comment

ID: 18815964
Did you try adding


Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 22

Expert Comment

ID: 18815968
The logs are lost because you are saving the parent document in the back-end while it is still open in the front end.

The right way would be to close the parent form while the child is opened for editing, then bring the parent form back up when the child closes.  That way the save to the parent back-end document will not be lost.

Unfortunately, there is a documented bug in the embedded view that prevents us from closing the parent document.  If you try to access a NotesUIDocument in the Queryopendocument event, the Notes client will crash every time.

This code illustrates the bug.  Place this code in the Queryopendocument event of your embedded view to make Notes crash whenever a related document is opened.

      Dim ws As New NotesUIWorkspace()
      Dim uidoc As NotesUIDocument
      Set uidoc = ws.CurrentDocument
      Call uidoc.Save()
      Call uidoc.Close(True)

If IBM would fix this bug, we could develop some very cool relational apps.  Bummer, huh?
LVL 31

Expert Comment

ID: 18816060
Well, you may be able to work around a way to close the parent document.  In the PostOpen event of the child doc, use NotesUiWorkspace to open the parent document then close the returned uiDoc handle.  I have not trie dthis, but it might work, since Notes USUALLY tries to open the existing instance of a document window instead of opening an additional instance.
LVL 22

Expert Comment

ID: 18816334
I've tried using the PostOpen event as a work around, but the side effects were not acceptable; especially then the document is opened via a DocLink.

The workaround that I use is to design the application such that I never write to a parent document while it is open.  For example, I would create the logs as separate, related documents and show those log documents in another embedded view.

Author Comment

ID: 18817068
- sysexpert, the updates take place in the response.. so the uidoc is the response

- qwaltee, uiwork.editdocument in a form event gives an error  :(

Bill, the queryopendocument thing migth work... If the uidoc.close is causing to crash.. (i hope!)

I will try adding a and see what happens (the parent is reloading if I call an action that edits/saves before opening the response)


Author Comment

ID: 18817153

Author Comment

ID: 18817247
I think the only way to solve it, is to get the Parent doc when it is opened  in the same state as when it is edited/saved...

i just have no idea how to get there..

tried saving in the postopen.. but with no results.
LVL 22

Accepted Solution

Bill-Hanson earned 250 total points
ID: 18817471
The bug prevents any use of the parent.uidoc in queryopendocument of an embedded view.  I've tried every workaround that I can think of to no avail.

One solution that don't really like, but works is this:
1.  Provide an Edit hotspot or button near the embedded view.
2.  When the user clicks Edit, the embedded view is displayed in a picklist.
3.  Operate on the document(s) selected in the picklist

That way, you avoid the embedded view bug, but it is not as clean as if the embedded view bug did not exist.

Also, if you open the document for editing in a dialogbox rather than in the client, you have complete control over the parent form after the response is saved.  Just refresh or reload the form after the call to NotesUiWorkspace.DialogBox.

Author Comment

ID: 18818481
I added the following to the response's Initialize sub..

      Dim uiwork As New NotesUIWorkspace
      Set uidoc = uiwork.CurrentDocument
      Call uidoc.FieldsetText("amended","xx")

seems to have done the trick... when intiialize runs, the document hasn't gone to the ui yet...

now i just need to add a few checks (that the uidoc is not nothing and is the correct form) and figure out which of the above are really required.. ( wasn't enough to have the parent reload on focus)

LVL 31

Expert Comment

ID: 18819544
Well, don't keep us in suspense.  Let us know what you figured out.

Author Comment

ID: 18819701
for some reason the parent doesn't reload with

the save on the uidoc's backend doc does the trick

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question