I have an application I am writing a search screen for which is fine. I collect the documents together into document collections using db.search etc., which is fine and plenty fast enough for what is required. I then put the resulting dc into a shared POFU folder to display embedded in the form to the user before exporting to a complex Excel format they require.... This folder is then used as the source of the data for the Excel report and is sorted into the way required for the exported worksheet by further LS code.
We are working on lowest common denominator, R5(.08!) at the moment...
If the users change their search criteria I clearly need to clear the search folders before the next search is added to them. At the moment i do it like this:
Set searchfolder=db.getview(fo
ldername)
Set vec=searchfolder.allentrie
s
Print "Removing old documents from folder"
counter=counter+1
SetStatus "Removing old documents from folder for .... report",counter
If vec.count >0 Then Call vec.RemoveAllFromFolder(fo
ldername)
The delay here can be quite long once no. of docs gets 500-1000, it often takes longer to clear the folder than to search the db. for the results they want, and because of the format required I have to keep two foldes - one "unfiltered" being their raw data choice and then a second based on effectively a manual join with another view to remove documents from certain criteria that is used for different parts of the Excel reports.
No I wouldn't have designed the db like that but it is there and that can't change!
On quite few occasions it will come back with "the network operation did not complete in a reasonable time" while clearing the folders
So.... is there any other way of clearing such a folder more quickly that I have missed? If I step through a loop of documents and remove each then that is of course even slower. Removing the private folder itself is an option (I use this with some versioning code in QueryOpen to determine if the user's version of the folder is out of date) but how can I then get LS to be able to re-create the POFU folder, at the moment it prompts the user saying design has changed, closes the uidoc and asks them to re-open. If I don't do this then the embedded folder shows as the design of the default view in the db instead of the correct POFU one.
It's Friday afternoon and any suggestions welcome, if I don't respond straight away sorry but will come back soon as I can.
thanks
Steve
Start Free Trial