Skip to main content
BlueMix free trial
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  


ws.ComposeDocument
Adam Jiros 12.Nov.12 04:00 AM a Web browser
Domino Designer -- LotusScript All Releases All Platforms

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
Call srcui.save
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)
Else
Call srcui.FieldAppendText("souvID", ";"+pole)
End If
Call srcui.save

Else
Messagebox "Není učen datum a čas konání porady", 48, "Chyba"
End If
Else
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...




ws.ComposeDocument (Adam Jiros 12.Nov.12)
. . RE: ws.ComposeDocument (M Greenberg 12.Nov.12)






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search


 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow