Link to home
Start Free TrialLog in
Avatar of HarryR3
HarryR3

asked on

Action on embedded view acts on doc containing the view, not the doc selected in the view

Hi

I have a view with an action that calls a simple LotusScript agent that runs on all selected docs in the view.
It sets a new value to a field in each doc.
This new value is then visible in the view.

When I click the action it acts on the selected docs which it finds with dc = db.UnprocessedDocuments.
dc.Count is equal to the number of docs selected.

So far so good.

I have embedded this view in a form and create a doc with this form so the view can be seen in context (= 'context' doc)
Now, when I click on the action at the top of the embedded view, dc = db.UnprocessedDocuments returns only one document which is the current 'context' document, not the documents selected in the view.

I developed this agent earlier specifically to use withing the embedded view and am convinced it was working.

I have rebooted in case Notes had got confused but no change.

Why is this happening?
How can I make the view action in the embedded view actually act on the view docs?

This is stopping me progressing so any suggestions welcome.

Regards
Harry
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

ASKER CERTIFIED SOLUTION
Avatar of mshogren
mshogren

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of marilyng
marilyng

in an embedded view, the context/focus is to the form and not the documents in the view.  To get the selected docs in the view, you'd need to move the action to the VIEW itself and have the view actions visible, else the focus will always revert back to the form.

Or try this: http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/e8b333d74a81456e85256d34004a9022?OpenDocument&Highlight=0,embedded,view,selected,documents

Or do a lookup for embedded view - selected documents in http://www-10.lotus.com/ldd/nd6forum.nsf
Ok - here's the solution that I use:  
    The form has a field that holds the selected document summaries from either a dialog list or picklist selection
    The botton half of the form resolves to an embedded folder (if many people are using this db, then the folder is private for that user -
     I usually check for the folder when the database is opened and create it programmatically, can also delete it when they close the
    database)

The form:  has a field (saveOptions, text, computed = "0", so it never saves)
   It has a layout region with a listbox with the lookup either to a @dbColumn("";"";"Lookup View";1), or if the view is
   extensive, It's a plain text, multivalue field that will display the results of a picklist.

    The lookup view is a single column with EITHER a concatentation of fields that provide the user with a summary so they can make
     a selection with a separator "|" and the document unid,  (this Summary|12334578910) <<For dialog list, checkbox, listbox.

     OR enough columns for the picklist.  The last column is the "summary|document unique id" (font is white, column width is 1, so it doesn't show in picklist),

     A "Go" button that takes the results of the selected (which would be the documentunid), gets the documents and puts them into the
     folder, then writes to a hidden "done" field, refreshes the form, and the other operation buttons can display based on the "Done" value.

     The embedded view is actually the private folder, depends on what I'm doing if I empty the folder when they open the form, or when
     they click on the go button.

-------------
     If you use a picklist, you can empty the results into the layout region listbox (selectedDocs), the user sees the summary, but in the back end you have the document unique id's that you can step through for processing.

Does this help?    
Avatar of HarryR3

ASKER

Hi

apologies for delay I'm a little tied up.

Seems this is quite an issue - why doesn't Notes allow simple access to selected docs in an embedded view? That's what views are for, innit?

I gave all points to mshogren as suggestion of putting LS code directly in embedded view's action button worked when I tried it and so solved the immediate problem. (banged my head against wall a dozen times for not having tried this myself before posting...).

The other suggestions are very interesting in the way that so much of Notes can be but increase complexity and for selection to be implemented in LS rather than using the view.
Don't have time now to mine this for any useful techniques but appreciate the time spent answering the question.