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

心已入冬 提交于 2019-12-08 03:30:52

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/28064521/how-to-save-form-values-to-db-in-domino-designer-by-lotus-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!