Search code examples
lotus-noteslotus-dominolotusscriptlotusdomino-designer-eclipse

how to save form values to DB in domino designer by Lotus Script


I am new to Domino designer and lotus script,

following my first question

1) How can I save form values to DB

2)How can I view DB( like MS access)

3) How to create view to retrieve values from DB

Googled for it but found a link to save to db solution.

I tried

Sub Click(Source As Button)
    Dim  myText As String
    Dim workspace As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
    Dim doc As NotesDocument
    Dim  enteredText As String

    Dim session As New NotesSession
    Dim db As NotesDatabase

    Set db = session.CurrentDatabase
    Set doc = New NotesDocument( db )
    doc.Form = "Main Topic"
    doc.Subject = "Here's a new document"
    Call doc.Save( False, False )//I think it is saving here but don'y know where it saves

    myText = Inputbox("insert some text :","Testing Heading","Default value",100,100)
    Msgbox "you have entered : "+myText 
    Set uidoc = workspace.CurrentDocument
    Set doc = uidoc.Document
    doc.addrfield = myText

    enteredText = doc.addrfield(0)
    Msgbox "Data entered in addrfield : "+ enteredText 
End Sub

But I don't know where it is saving my form fields

If possible please provide links to sites where DB and view are discussed along with codes.

Thanks in advance

The above one is solved! Thanks Knut

Edit 1:

I want to create a Java agent which will generate a text file (create a simple report) of the data in the database .

How can I add Java Agent ? How can I get access data(form fields) in the database ? Where should I place the java code?


Solution

  • 1)

    Add Call doc.Save( False, False ) after doc.addrfield = myText. Only this will save the changes you made in document.

    2) + 3)

    Create a form "Main Topic" in Domino Designer and add the fields you want to see when opening a document which has field Form = "Main Topic"

    Create a view in Domino Designer. Create columns which show your fields you created in document

    4)

    Read this http://www.redbooks.ibm.com/Redbooks.nsf/RedbookAbstracts/sg246854.html?OpenDocument as an introduction to classic Notes application development.