troubleshooting Question

Problems opening folders that I automatically created via Lotus Script...

Avatar of maximjon
maximjon asked on
Lotus IBM
6 Comments3 Solutions1317 ViewsLast Modified:
Hello Everyone,

I need to be able to give users the flexibility to create their own reports in a Lotus Notes database.  Maybe there's an easier way and I might be taking the wrong approach to the design of this database, but I essentially created a form that will manipulate the Notes full text search functions.

Right now the form only has three fields: a text field for the Report Title and two date fields (Start and End).

After the user clicks the 'create report' button, the code I specified below executes.

The program gathers all documents that fall within the date range the user specifies and then dumps them in a folder that is created with the title of whatever the user typed into the 'Report Title' field.

Now the problem I'm having is actually opening up that new folder that was just created.  I put the line: Call ws.CurrentDatabase.OpenView(ReportTitle)   at the end of the code but I get the error message: "View or Navigator '[folder name]' does not exist.  The folder does however exist.  If I close out and come back in I see that it was created by the code.

Is there some other way I should be doing this?  or is my concept of creating a 'reporting form' just poor design all together?

All suggestion appreciated.  Thanks,


Sub Click(Source As Button)
	Dim ws As New NotesUIWorkspace
	Dim s As New NotesSession
	Dim db As NotesDatabase
	Dim vw As NotesView
	Dim doc As NotesDocument
	Dim uidoc As NotesUIDocument
	Dim j As Long
	Dim count As Integer
	
	Set db = s.CurrentDatabase
	Set vw = db.GetView("Main")
	Set uidoc = ws.CurrentDocument
	
	ReportTitle = uidoc.FieldGetText("rptTitle")
 
	Call db.UpdateFTIndex(True)
	
	strSearch = "[dataEndTS] >= " & uidoc.FieldGetText("rptStartDate") & " And [dataEndTS] <= " & uidoc.FieldGetText("rptEndDate")
	j = vw.FTSearch(strSearch, 0)
	
	count = 0
	
	Set doc = vw.GetFirstDocument
	While Not(doc Is Nothing)
		Call doc.PutInFolder(ReportTitle, True )
		Set doc = vw.GetNextDocument(doc)
		count = count + 1
		Print count
	Wend
	Call vw.Clear
	
	Messagebox "Report is complete"
	
	Call ws.CurrentDatabase.OpenView(ReportTitle)
End Sub
ASKER CERTIFIED SOLUTION
Bill-Hanson

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros