developerWorks  >  Lotus  >  Forums & community  >  IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

Feedback Type Problem
Subject ws.ComposeDocument
Product Area Domino Designer on Eclipse (DDE)
Technical Area Error Message
Platform Windows
Release 8.5.3
Hi everybody, I'm having trouble with ws.ComposeDocument() I have an action in Form on button, that should open a new document (Form). But I'm getting error 'Variable not set'.

I'm quite new to Lotusscript...

Sub Click(Source As Button)
Dim ses As New notessession
Dim ws As New NotesUIWorkSpace
Dim srcui As NotesUIDocument
Dim srcuii As NotesUIDocument
Dim db As notesdatabase
Set srcui = ws.CurrentDocument
Set db =ses.currentdatabase

If srcui.FieldGetText("PoradaType") <> "" Then
If srcui.FieldGetText("PoradaDate") <> "" And srcui.FieldGetText("PoradaTime") <> "" Then
If srcui.EditMode Then
End If

Call srcui.close
Set srcuii = ws.ComposeDocument( , , "bod") '"bod"
Dim pole As String
pole = srcuii.FieldGetText("IDbodu") '****Do pole se nahraje ID bodu
If srcui.editmode =False Then
srcui.EditMode = True
End If
If srcui.FieldGetText("souvID") = "" Then
Call srcui.FieldAppendText("souvID", pole)
Call srcui.FieldAppendText("souvID", ";"+pole)
End If

Messagebox "Není učen datum a čas konání porady", 48, "Chyba"
End If
Messagebox "Není učen typ porady", 48, "Chyba"
End If

End Sub

'And Postopen action of a new document

Sub Postopen(Source As Notesuidocument)
'Call source.Save
'Set srcdoc = Source.Document
If source.IsNewDoc Then
Call source.FieldSetText("MailedResources", "")
Call source.FieldSetText("MailedAttendes", "")

GoBack = True

' nastavení políčka Servers
Dim ses As New NotesSession
Dim db As NotesDatabase
Set db = ses.CurrentDatabase
Dim srvnm As New NotesName(db.server)
srvname$ = srvnm.Canonical
If srvname$ <> "" Then uname$ = Lcase$(srvname$) Else uname$ = Lcase$(ses.UserName)
Dim pdoc As NotesDocument
Set pdoc = db.GetProfileDocument( "ProfileDocument", uname$)
' setup databáze
serverS$ = pdoc.GetFirstItem ("ServerDB").text
pathS$ = pdoc.GetFirstItem ("CestaDB").text + pdoc.GetFirstItem ("SouborDB").text
Dim sdb As New NotesDatabase (serverS$, pathS$)
Dim spdoc As NotesDocument 'setup profile document
Set spdoc = sdb.GetProfileDocument("ProfileDocument")
Call source.Document.ReplaceItemValue("Servers", spdoc.Servers)
End If
ano = ""
ne = ""
End Sub

Thank you for your help...

Feedback number WEBB8ZYDS9 created by Adam Jiros on 12/09/2019

Go back