Refresh uidoc with embedded view

Hi There,

Very quick question, how do i refresh the uidoc after the user clicks a button to create a response document?

I have an embeeded view with a button next to it (on the form) which allows the user to create a document that should appear in the embedded view, but it only appears after i press F9.

I have tried a uidoc.refresh in the button, but it runs it too early, before the document has been created.

Thanks for any help

F1H

Subject: Refresh uidoc with embedded view

Is the new document opening in a new tab, being edited, saved then closed? If so refreshing the original doc could be an issue.

If the button is creating the document all in lotusscript then you can probably use workspace.viewrefresh at the end of the button’s code without a problem.

Subject: RE: Refresh uidoc with embedded view

The document is being opened in a fresh tab, then files are attached to the form and then it is saved and closed.

i am using the workspace.composedocument command, so, i think you are right, refreshing the main doc will be an issue.

Thanks

F1H

Subject: RE: Refresh uidoc with embedded view

Create an agent that triggers Notesuiworkspace.ViewRefresh

Run the agent at the end of Save / Close action button

This will only work if user presses the button the close the form

Subject: RE: Refresh uidoc with embedded view

Yes, I guess you could create the doc, save it refresh the workspace then open in with workspace.editdocument, but that would cause problems if people had the option to cancel out without saving at the moment.

Something else I tried in the past was to put a refresh in the queryclose of the new document - seem to remember having limited success with it though.

Subject: Refresh uidoc with embedded view

I found this seems to work, add the following code to your button, which creates the document:

    Call ws.ViewRefresh 

    Call uidoc.RefreshHideFormulas 

    Call ws.ViewRefresh 

On the embedded view itself, make sure there is a hide-when formula. If there isn’t any, give the embedded view the formula: 1=0.