?
Solved

uidoc not reloading

Posted on 2007-03-29
15
Medium Priority
?
711 Views
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

0
Comment
Question by:miklesw
[X]
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
15 Comments
 
LVL 19

Expert Comment

by:madheeswar
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
0
 
LVL 1

Author Comment

by:miklesw
ID: 18814297
     
                     AuditFileUNID=uidoc.Document.ParentDocumentUNID
      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.Location="Basement"
      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")
      uidoc.save
                     Call uidoc.Close(True)            
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 18815964
Did you try adding

uidoc.reload
uidoc.refresh

0
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

by:Bill-Hanson
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?
0
 
LVL 31

Expert Comment

by:qwaletee
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.
0
 
LVL 22

Expert Comment

by:Bill-Hanson
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.
0
 
LVL 1

Author Comment

by:miklesw
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 uidoc.save and see what happens (the parent is reloading if I call an action that edits/saves before opening the response)

0
 
LVL 1

Author Comment

by:miklesw
ID: 18817153
nsd!!!!!!!!!!!!!
0
 
LVL 1

Author Comment

by:miklesw
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.
0
 
LVL 22

Accepted Solution

by:
Bill-Hanson earned 1000 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.
0
 
LVL 1

Author Comment

by:miklesw
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")
      uidoc.Refresh
      uidoc.save
      Call uidoc.Document.save(False,False)

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.. (uidoc.save wasn't enough to have the parent reload on focus)


0
 
LVL 31

Expert Comment

by:qwaletee
ID: 18819544
Well, don't keep us in suspense.  Let us know what you figured out.
0
 
LVL 1

Author Comment

by:miklesw
ID: 18819701
for some reason the parent doesn't reload with uidoc.save

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

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

752 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