Hier der Code.
Sub Initialize
Dim s As New NotesSession
Dim doc As NotesDocument
Dim db As NotesDatabase
Dim col As NotesViewcolumn
Dim formula As String
Dim maske As String
Set db = s.CurrentDatabase
Set doc = s.DocumentContext
Dim viewSavedView As NotesView
Dim viewNew As NotesView
Dim delView As Notesview
Set delview = db.GetView( "MySelectedView" )
If Not delview Is Nothing Then
Call delview.Remove
Set viewSavedView = s.CurrentDatabase.GetView("MyBearings")
Set viewNew = db.CreateView("MySelectedView")
' viewNew.SelectionFormula = "SELECT FORM='form' & productgroup='" & doc.productgroup(0) & "'"
viewNew.SelectionFormula = "SELECT FORM='form' & productgroup='" & doc.productgroup(0) & "' & language='" & doc.language(0) & "'"
Call viewNew.RemoveColumn(viewNew.ColumnCount)
Set col = viewNew.CopyColumn(viewSavedView.Columns(1),1)
Set col = viewNew.CopyColumn(viewSavedView.Columns(2),2)
Set col = viewNew.CopyColumn(viewSavedView.Columns(3),3)
Set col = viewNew.CopyColumn(viewSavedView.Columns(4),4)
Set col = viewNew.CopyColumn(viewSavedView.Columns(5),5)
Set col = viewNew.CopyColumn(viewSavedView.Columns(6),6)
Set col = viewNew.CopyColumn(viewSavedView.Columns(7),7)
Set col = viewNew.CopyColumn(viewSavedView.Columns(
,8)
Print "<SCRIPT LANGUAGE=JavaScript>"
Print "location.href='
http://localhost/cc.nsf/SearchDocuments2?OpenForm'"
Print "</SCRIPT>"
Else
Set viewSavedView = s.CurrentDatabase.GetView("MyBearings")
Set viewNew = db.CreateView("MySelectedView")
'viewNew.SelectionFormula = "SELECT FORM='form' & productgroup='" & doc.productgroup(0) & "'"
viewNew.SelectionFormula = "SELECT FORM='form' & productgroup='" & doc.productgroup(0) & "' & language=" & doc.language(0)
Call viewNew.RemoveColumn(viewNew.ColumnCount)
Set col = viewNew.CopyColumn(viewSavedView.Columns(1),1)
Set col = viewNew.CopyColumn(viewSavedView.Columns(2),2)
Set col = viewNew.CopyColumn(viewSavedView.Columns(3),3)
Set col = viewNew.CopyColumn(viewSavedView.Columns(4),4)
Set col = viewNew.CopyColumn(viewSavedView.Columns(5),5)
Set col = viewNew.CopyColumn(viewSavedView.Columns(6),6)
Set col = viewNew.CopyColumn(viewSavedView.Columns(7),7)
Set col = viewNew.CopyColumn(viewSavedView.Columns(
,8)
Print "<SCRIPT LANGUAGE=JavaScript>"
Print "location.href='
http://localhost/cc.nsf/SearchDocuments2?OpenForm'"
Print "</SCRIPT>"
End If
End Sub
Gruss
Andreas