Error: Index is not to be generated in server.

I have a form that searches a date range. In my code before I search again I use this:(see below) to remove the content of the folder. Is there another way to do this.

Dim vc As notesviewentrycollection
Set view=db.Getview("Date Range Report")
Set vc=view.AllEntries
Call vc.RemoveAllFromFolder("Date Range Report")
cyleAsked:
Who is Participating?
 
marilyngCommented:
cycle, if your folder is shared, private on first use, then the folder must exist before you call your code.  Which means the first time you attempt to call your code, it tries to create the folder, and it fails.

Normally, you have to jump through a couple of hoops and create the private folder first, then you can write to it.  So, in your script, when you first open it, you first need to check to see if the folder is there.  Another thing I have done is to check for the folder when I open the database.  Or, my clever workaround:

Instantiate an EMPTY collection:

set coll = thisotherview.getalldocumentsbyKey("zzzzz",true)
call coll.putallinfolder(thisPrivateFolder, true) <<True I think will create the folder if it doesn't exist. - solly, not at a notes computer to check.

More workarounds:
http://www-1.ibm.com/support/docview.wss?rs=0&uid=swg21094072
0
 
cyleAuthor Commented:
Using Notes and the error I got was my Title.
0
 
mshogrenCommented:
Hi,

This occurs when you are working with a private folder.  Is it possible to chnage this folder so it is not a private folder?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
cyleAuthor Commented:
It is Shared, private on first use. If I dont change, how can I delete result in folder? Or I do change ---- to what?
0
 
mshogrenCommented:
If the folder is changed to Shared then your code should work.  I am still thinking of other alternatives.  Could you tell me how the variable db is defined in your code.
0
 
cyleAuthor Commented:
Set db = session.CurrentDatabase
0
 
mshogrenCommented:
How is the code called.  Is it in an agent? Is it called via the web?  I am not sure if that information is going to help but I am still thinking about this one.

Please let me know if changing the folder to be Shared works.
0
 
marilyngCommented:
Oops, hit enter too soon.  Then if the folder does exist,you need to check to see if it contains documents, else that will throw an error, too. If it does, then remove documents. Else, do the rest of your code.  No sense in taking up processing time unless there are documents to remove.
0
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.