@Dialgogbox or window.open to creat a new form

I'm looking for and agent (Button) that will creat a form in a differnt db. When the agent creates the form, it must be in a pop-up. I dont want a full screen, just a small pop-up. I know how to user the @dialogbox, but I dont know how to call it from a differnt db. I will be sending out a message with a button, and once the user presses the button, it will need to know how to get to the other database to  creat the new form in a pop-up style.
dennis_gardinAsked:
Who is Participating?
 
BlackmoorianConnect With a Mentor Director of Professional ServicesCommented:
Haven't heard any response from the Asker as to whether the solution was what was looked for.
0
 
BlackmoorianDirector of Professional ServicesCommented:
     Here is a lotusscript code you could use. Replace the values in [ ] with true values...
      
      Dim ws As New NotesUIWorkspace
      Dim db As NotesDatabase
      Dim doc As NotesDocument
      Dim srv As String
      Dim path As String
      Dim uidoc As NotesUIDocument
      
      'Location variables for other database
      srv = "ServerName"
      path = "[Path and FileName]"
      
      Dim db As New NotesDatabase( srv, path )
      Set doc = New NotesDocument( srdb )
      doc.Form = "[FormName]"
      '<You can auto set any other fields here>
      doc.date = Cstr(Today())
      doc.username = Cstr(s.CommonUserName)
      'etc
      '<end field assignment>
      
      Set uidoc = ws.DialogBox( [FormName] , [autoHorzFit] , [autoVertFit] , [noCancel] , [noNewFields] , [noFieldUpdate] , [readOnly] , [title$] , doc , [sizeToTable] , [noOkCancel] , [okCancelAtBottom] )


Parameters for DialogBox (taken from Help file)

autoHorzFit
Boolean. Optional. Specify True to scale the dialog box horizontally to fit the first layout region or table on the form. Otherwise, the dialog box is not scaled horizontally.
autoVertFit
Boolean. Optional. Specify True to scale the dialog box vertically to fit the first layout layout region or table on the form. Otherwise, the dialog box is not scaled vertically.
noCancel
Boolean. Optional. Specify True to not display the Cancel button. Otherwise, the dialog box contains the Cancel button.
noNewFields
Boolean. Optional. Specify True to not add fields that are on the dialog box form but not on the underlying form to the underlying document. Otherwise, all dialog box fields are passed to the underlying document.
noFieldUpdate
Boolean. Optional. Specify True if to not pass any edits from the dialog box to the underlying document (for example, if you're passing the edits somewhere else in a Queryclose script for the dialog box form). Otherwise, the edits are passed to the underlying form.
readOnly
Boolean. Optional. Specify True to prohibit writing to the dialog box (for example, if you are using the dialog box to display a help screen). Otherwise, the dialog box is read-write. This option makes noCancel true.
title$
String. Optional. A title for the dialog box. Defaults to "Lotus Notes."
sizeToTable
Note  This parameter is new with Release 5.
Boolean. Optional. Specify True to apply autoHorzFit and autoVertFit to the first table on the form. Otherwise, they are applied to the first layout region on the form.
noOkCancel
Note  This parameter is new with Release 5.
Boolean. Optional. Specify True to not display the OK button. Otherwise, the dialog box contains the OK button. Using this parameter prevents any changes made in the dialog box from being reflected in the current document. Use the RefreshParentNote method if you want changes to be reflected in the current document but don't want an Ok button to display.
okCancelAtBottom
Note  This parameter is new with Release 6.
Boolean. Optional. Specify True to display the OK and/or Cancel buttons side-by-side at the bottom right of the dialog box. If you specify False or omit this parameter, the buttons appear stacked at the top right.
0
 
BlackmoorianDirector of Professional ServicesCommented:
My apologies I typoed the one line... "Set doc = New NotesDocument( srdb )"

Should be "Set doc = New NotesDocument( db )"


0
 
BlackmoorianDirector of Professional ServicesCommented:
Also if you are going to pull CommonUserName don't forget to include

"Dim s As New NotesSession"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.