"Select All" problem in embedded view

I am having problem using Ctrl + A / Edit -> Select All/ Using formulas to select all documents in an embedded view on a form. Because the number of records in the view is big having the select all function is crucial. Have any expert here faced this problem before?
Who is Participating?
marilyngConnect With a Mentor Commented:
What are you trying to achieve? The embedded view is going to be less functional in this respect, and you may have to resort to an agent/button.
LeepingtangAuthor Commented:
Hi marilyn,

The purpose of the select all is to reduce the work load required to select the thousands of records to be exported to excel. Thanks. I have tried creating a button with formulas but it wouldn't work. You suggest scripts will work?

Well, the embedded view is going to be hard to get a handle on.  If you're just searching for a way to export the entire view to excel, then it can be done with some caution.

Thousands of documents take a bit of time, in a network environment where the users are in the same building as the server, or on a GIGe line, then the thousands of documents process quickly.  Over a WAN, ugh.

I had such an application running  a large, accounting report of several thousand lines, formatted, etc.  Over LAN, quick. Over WAN.. start Friday night and maybe it will be done the next day.  The solution was to replicate a copy of the database to the other city, or export to csv or xml.

At any rate.  Back to your problem.   The problem that you will have with the embedded view is that the form takes the focus, so you can't identify selected documents in the view.

If you just want to export all the documents in the view, and you already know the view name, then that's not a problem.  YOu can adjust any script to do this.  

Exporting selected will be a problem, and one way to do this is to embed the actions on the view action bar:  select these, move to folder, and then export all the documents in that folder.  This will take some creative @Formulas and calling some Notes Agents.  (run agent to clear documents in the folder, get selected and move to folder, run agent to export all documents in that folder to excel)


Good examples of excel exports.
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

LeepingtangAuthor Commented:
Well, its another "no" i suppose. Everyday i am finding a new "impossible" for Lotus Note. Great FUN!
Will allocate the points to you as you are the only one who replied. Thanks Marilyn!
Not really impossible, just needing a creative work around, that's all.  Did you need help with the view action button?
LeepingtangAuthor Commented:
Actually yes i do Marilyn. I have tried using formulas and keyboard shortcuts. No luck still.
Ok, tell me what you want to do, you want to select all documents to do what?  
LeepingtangAuthor Commented:
I have already created an exoprtr function that worked fine, marilyn. The thing is the documents are incrementing horribly to nearly 10,000+ already, selecting individually wouldn't be efficient. The view has to be embedded as it is categorised to a single category. It would be nice if there can be a button that will select all the documents.
Ok, on the embedded view, you have a handle on the "Category" right?  You also know the view name, right?

So, you don't need to select all the documents, you need a button that will export the "category" from the "view" and then export those documents.

Since you have to use script to do the export, just make sure that your form has a category field, and the "viewname" field.

your "Export all button" can be on the form, and doesn't need to be on the view, since you have a handle on the FORM.

Dim session as New NotesSession
Dim db as NotesDatabase
Dim ws as New NotesUIWorkspace
Dim uidoc as notesUIDocument
Dim doc as NotesDocument
set db = session.currentdatabase
set uidoc = uidoc.currentdocument
set doc = uidoc.document
'Now you have a handle on the OPEN form
Dim viewname as string
Dim categoryname as string
dim collection as NotesDocumentCollection
Dim view as NotesView
viewname = doc.getItemValue("YourViewNameField")(0)
if viewname ="" then
    msgbox "Sorry, the lookup view is not defined..",,"Unable to Continue"
    exit sub
end if
set view = db.getView(viewname)
if view is nothing then
   msgbox "Sorry, unable to locate: " + viewname,,"Unable to Continue"
   exit sub
end if
categoryname = doc.getItemValue("YourCategoryField")(0)
if categoryname = "" then
   msgbox "Sorry, unable to locate the category",,"Unable to continue"
   exit sub
end if
'Now see if you have any documents matching the category
set collection = view.getalldocumentsbykey(categoryname, true)
if collection.count <1 then
   msgbox "Sorry, there were no documents in " + viewname + " view matching this key: " + categoryname,,"No Matching documents"
   exit sub
end if

'Now you have a collection of documents identified - same thing as select all.  :)

Dim exportdoc as NotesDocument
set exportdoc = collection.getfirstdocument
while not exportdoc is nothing]
   'do you export here based on each document
    'Get the next document in the collection
    set exportdoc = collection.getnextdocument(exportdoc)

if not collection is nothing then set collection = nothing

'Do the rest of your cleanup stuff... remember to release the memory and close excel.

Simple.  You gave up too soon. ;)
LeepingtangAuthor Commented:
Yes marilyn, i gave up too soon indeed. I have just started playing with domino a month ago so i think i will need your help a LOT in the future!
I am going to try the code right now. fingers crossed, you are my life saviour! ( if it works ) haha!
Not tested, wrote it on the fly.. so, fingers crossed, too!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.