Manage Learn to apply best practices and optimize your operations.

Create A Doc In Remote Database From The Create Menu

Have you ever wanted to add a link to the create menu that creates a document
in a DIFFERENT database? It's easy. Simply create a new form in your main
database, give it a name, and copy the following (modified) code into the Post
Open event. When you create a document using this form, the script will tell
Notes to close the open document and create another document in another
database. You just have to specify which database and form by changing 3 lines
of code below.

I found this useful for allowing users to give feedback. I copy my 'Give
Feedback' form to each database I create, and the feedback data is always
entered in a single database.
Sub Postopen(Source As Notesuidocument)

Dim s As New Notessession
Dim w As New NotesUIWorkspace
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim sServer as String
Dim sDatabase as String

'Variables
sServer = <&LTYOUR SERVER NAME HERE>>
sDatabase = <&LTYOUR DATABASE PATH AND NAME HERE>>
sForm = <&LTTHE NAME OF THE FORM>>

'Get other database and create document
Set db = s.CurrentDatabase
Set uidoc = w.ComposeDocument(sServer, sDatabase, sForm)

'Set some fields too.
Call uidoc.FieldSetText("DatabaseName", db.Title)
Call uidoc.FieldSetText("DatabaseServer", db.Server)
Call uidoc.FieldSetText("DatabaseFileName", db.FilePath)
Call uidoc.Refresh

'Close current doc
source.Close


End Sub

Dig Deeper on Domino Resources - Part 3

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close