Form: CustomShowDocFields2
Add following:
Globals/Declaration: Dim uidoc As NotesUIDocument
Globals/Initialize: Set uidoc = ws.CurrentDocument
Change following:
Form/QueryOpen:
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
Const DEBUG = False<br/>
If(Not ws.CurrentView Is Nothing) Then<br/>
'### categories starts with '8000'<br/>
If( Not Instr(ws.CurrentView.CaretNoteID,"8000") = 1) Then<br/>
notesID = ws.CurrentView.CaretNoteID <br/>
If(DEBUG) Then Msgbox("NoteID: "+notesID)<br/>
databasePath = ws.CurrentView.View.Parent.filepath <br/>
If(DEBUG) Then Msgbox("DatabasePath: "+databasePath)<br/>
server = ws.CurrentView.View.parent.server<br/>
If(DEBUG) Then Msgbox("Server: "+server)<br/>
Exit Sub<br/>
End If<br/>
Elseif (Not uidoc Is Nothing ) Then<br/>
notesID = uidoc.Document.NoteID<br/>
If(DEBUG) Then Msgbox("NoteID: "+notesID)<br/>
databasePath = uidoc.Document.ParentDatabase.FilePath<br/>
If(DEBUG) Then Msgbox("DatabasePath: "+databasePath)<br/>
server = uidoc.Document.ParentDatabase.Server<br/>
If(DEBUG) Then Msgbox("Server: "+server)<br/>
Exit Sub<br/>
<br/>
End If