Refresh Embedded view on Parent when child response saves and closes without opening new parent window on newdoc

Posted on 2011-10-09
Last Modified: 2013-12-18
Hi, I have an embedded view of Response docs on Parent form that need to refresh.
1st problem: If the Parent is a New Doc, and once the response is created from the parent and saved/closed, I need the Embedded View to Refresh.
I found this code from this forum that refreshes embedded view if parent is new doc, but a second Parent Window is opened if the Parent is a new doc. Code is in queryclose event of child.
After closing Parent, I'm faced with having a 2nd Parent window to close.

2nd problem with using this code: From the view navigation, if you open a response doc, and after it closes, it re-opens the Parent, when I just need it to go back to the view navigation.

How do I modify this code to refresh embedded view on parent w/out the 2nd window opening.  If there is a better way, please explain with a workable example.   Thanks in advance for your help.  I researched this time and time again with no resolution.  High points for a working resolution.
' refresh parent EMBEDDED VIEW  by opening parent and refreshing.  The False is used to get handle on current parent window if open, otherwise open new window
	If Source.EditMode = True   And  Source.IsNewDoc = False Then		
		Dim session As New NotesSession
		Dim ws As New NotesUIWorkspace
		Dim db As NotesDatabase
		Dim doc As NotesDocument
		Dim uiDoc As NotesUIDocument
		Set db = session.CurrentDatabase
		Set doc = db.GetDocumentByUNID(Source.Document.ParentDocumentUNID)   ' get invalid unique id error
		Set currentDoc = Source.Document
		Set uiDoc = ws.EditDocument(True, doc, False, "", False, False)   'The False is used to get handle on current parent window if open, otherwise open new window
		Call uiDoc.Refresh
	End If

Open in new window

Question by:KTTKTT

    Author Comment

    Forgot to mention that the Embedded view needs to show as a Single Category, which is reason it's probably not refreshing on first response entry.

    Accepted Solution

    Found my own solution with further research:

    Posted by Erwin Heeren on 25.Jun.09 at 06:36 AM using a Web browser
    Category: Domino DesignerRelease: 6.5.5Platform: Windows 2000

    You can simulate F9 in your script. This can refresh the parent form from an embedded view action.

    'Global Declaration
    Declare Sub keybd_event Lib "user32.dll" (Byval bVk As Integer, Byval bScan As Integer, Byval dwFlags As Integer,Byval dwExtraInfo As Integer)

    Sub F9

    Const VK_F9 = &H78


    'Press and release F9
    keybd_event VK_F9, 0 , KEYEVENTF_KEYDOWN , 0
    keybd_event VK_F9, 0 , KEYEVENTF_KEYUP , 0

    End Sub

    ------------------Have to do a :  Call F9   .  I placed this in both my parent and response forms.  works great.  Bless this programmer
    Posted by Erwin Heeren on 25.Jun.09 at 06:36 AM using a Web browser
    Category: Domino DesignerRelease: 6.5.5Platform: Windows 2000

    Author Closing Comment

    Found new solution with further research.  Documented here.
    LVL 46

    Expert Comment

    by:Sjef Bosman
    Here's a much older link that points to a much more complete solution:

    By the way, I hope you don't have to develop this for Linux or Mac clients...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
    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 sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now