Is this possible? I have embedded views, and want to be able to use data in the uidoc from an action on the embedded view (because I also want to do stuff with the selected documents). The view could be in a dialog box as well as a normal uidoc
I’ve tried w.currentdocument, but that doesn’t get anything at all.
Subject: get a handle on the uidoc from an embedded view
If you are opening a doc in the embedded view, you can do something like this:Dim ws as New NotesUIWorkspace
Dim uidoc as NotesUIDocument
Set uidoc = ws.CurrentDocument
Alternatively, if you are using an embedded view, you may be using single category. If so, you will have data on the doc being open that identifies the uidoc. If you had a lookup view selecting the these uidocs, sorted by this key you could get the uidoc from the view.
This is very useful if maintaining totals in the uidoc, based upon the sum of data stored in in the individual docs.
Subject: RE: get a handle on the uidoc from an embedded view
Dominic
Thanks for responding, but I’m not able to get either of your options working.
I think the problem lies in the fact that I’m trying to use an action on the view that’s embedded.
set uidoc = w.currentdocument doesn’t return a uidoc, and using the global variable option works when running an action from the document, but not when using the action on the embedded view.
The problem is that I need to use the action off the embedded view, because I need to get the docs from the view.
Subject: RE: get a handle on the uidoc from an embedded view
Hi Dan
How are the documents selected for the embedded view?
Are you saying that within the embedded view, you want to select n documents and click a button that will use data in the uidoc to update the selected docs in the embedded view?
Your previous reply suggested that you are not using a single category view. Does the embedded view select responses? If so, the $Ref field will have the UNID of the parent, and that can be used to get the uidoc, (db.GetDocumentByUNID).
Subject: RE: get a handle on the uidoc from an embedded view
Thanks again Dominic
Unfortunately, while the view is a single category view, they aren’t responses to the parent doc, and contain no info about the doc the view is embedded in.
I’ve now changed the design slightly to get rid of this need, it just means one extra step for the user which I would have liked to have got rid of.
Subject: RE: get a handle on the uidoc from an embedded view
Hi Dan
If the view is a single category, there should be a solution. A field on the uidoc must store the single category. You can therefore locate the uidoc in a view using the category as the key.
Subject: RE: get a handle on the uidoc from an embedded view
Dominic - This does not solve the problem of “selecting” some of the documents in the embedded view. I too have that need (as I’ll bet a zillion others have) - consider simple things like an action button to toggle the value of a field in selected documents. Your solution would work for the whole category but not a subset of the category.
embedded views and editors have a lot of potential but seem to come up short in many areas.
When the user opens the main doc, the postopen event saves the docunid in a field in a profile doc. Then, from an action in the embedded view, I open a dialog box for inputs. The postopen event of the dialog box calls up the docunid from the profile doc and puts it in a field on the dialog box form. My own ‘save’ button on the dialog box then calls LS code to do further processing - and I have access to the main doc thru the docunid stored in the uidoc (the dialog box).