Creating a folder from a view design, easy right?


You would think that it would be possible to create a folder from a certain view design in LotusScript, right?.


Creating a folder in LS is very easy:

  Setdb=session.Currentdatabase
 db.Enablefolder(
"MyNewFolder")

But where does the design come from? The default view?

I haven't checked, but it is very clear that there should of course have been another parameter in the
"EnableFolder" call indicating which view the folder should be created from to make it any useful.

Fortunately there is an undocumented call to fix the problem. From version 5.03 a hidden formula function exists:

@UpdateViewDesign("foldertarget";"viewsource")

So by calling:

Dim session As New NotesSession
Dim db As NotesDatabase

Setdb=session.Currentdatabase
db.Enablefolder(
"MyNewFolder")
Evaluate(|@UpdateViewDesign("MyNewFolder";"SourceView")|)     

the folder is "created" from a sourceview.


Posted on 06/27/2010 12:31:24 PM CEDT