weird – I have an agent (many thanks to the people in this forum) that is supposed to update the folder design for the private folders but it’s modifying the actual main ‘source’ folder instead. How can I get it to update the shared private on first use folder?
Sub Initialize
Dim s As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim uiview As NotesUIView
Dim db As NotesDatabase
Dim view As notesview
Set db=s.CurrentDatabase
Set uiview = workspace.CurrentView
Set view = db.GetView(uiview.ViewName )
’ Messagebox view.ViewName
If view.IsFolder= False Then
Msgbox "Operation canceled - only valid for folders"
Exit Sub
End If
Call UpgradeHandling(uiview.ViewName , uiview.ViewName )
End Sub
Sub UpgradeHandling(folder As String, source As String)
'// This function will upgrade folder design
Dim functionName As String
'Start additional code section 1:
Dim s2 As New notessession
Dim db2 As NotesDatabase
Dim view As NotesView
Dim viewdoc As NotesDocument
Dim savename As String
Set db2=s2.CurrentDatabase
'End of additional code section 1
functionName = "UpgradeHandling"
On Error Goto TrapError
'Start additional code section 2:
'The code in the IF section checks for starting and ending quotes in the name
'and temporarily swaps the trailing quote, upgrades the design,
'and changes the view name back to the original.
If Left(folder, 1)=|"| And Right(folder, 1)=|"| Then
savename=folder
folder= "begin" & Mid$(folder, 2, Len(folder)-2) & "end"
Set view=db2.getview(savename)
view.name=folder
Evaluate(|@UpdateViewDesign("|& folder & |";"| & Source & |")|)
'reset name back to original
view.name=savename
Set viewdoc=db2.getdocumentbyunid(view.universalid)
Call viewdoc.sign
Call viewdoc.save(True, True)
Else
'End of additional code section 2
'Performs the design upgrade for views/folders that don’t contain a quote in the name.
Evaluate(|@UpdateViewDesign("|& folder & |";"| & Source & |")|)
'Start of additional code section 3
End If
'End of code section 3
Exit Sub
TrapError:
Msgbox "Error on " & functionName & " >> " & (Err & ": " & Error$)
Exit Sub
End Sub