Monday, September 7, 2009

Agent to customize Dialogbox to take the inputs from the user



Create a form with the name "DlgPreview"

Customize the form "DlgPreview" as shown below


Click on Submit and write the below lotusscript code:

Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesuiDocument
Set uidoc = ws.CurrentDocument
Call ws.RefreshParentNote( )
Call uidoc.Close
End Sub

Cancel Button Code:

Formula Language: @Command([FileCloseWindow])

Write an agent to trigger the workspace dialogbox.

Agent Code : LotusScript :

Sub Initialize
Dim ws As New NotesUIWorkspace
Dim s As NotesSession
Dim db As NotesDatabase
Dim doc As NotesDatabase
Dim dlgDoc As NotesDocument
Set s = New notessession
Set db = s.CurrentDatabase
Set dlgDoc = db.CreateDocument ()
If ws.DialogBox("DlgPreview",True,True,True,False,False,False,"Preview Dialog Box",dlgDoc,True,True) Then
Msgbox DlgDoc.DlgField(0)
End If
End Sub

After you run the agent it will display the below dialogbox to enter the value


No comments:

Post a Comment

Search This Blog