1

I am new to Domino designer and lotus script,

I tried to access my text field by:

Sub Click(Source As Button)
    Dim  myText As String
    myText = Inputbox("insert some text :","Testing Heading","Default value test",100,100)
    Msgbox "you have entered : "+myText 
    [myfield].text = myText  //error
End Sub

but it shows an error:

named product field does not exist

Googled for it but can't find the solution.

One more, searched for tutorials for creating forms,views,database in domino designer for beginners. But can't find one.

If possible please provide links to tutorial sites.

EDIT 1:

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
    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 
    Msgbox "Data entered in addrfield : "+ enteredText //error
End Sub

Error:

Object variable not set

EDIT 2:

@Knut In Domino Designer, how database tables can be created ? I mean something like create table <tablenam> (field1,feild2,..);
How can I access it. I refered this. This guy showed me how how to connect to database but did't show how to create DB table.

nempoBu4
  • 6,521
  • 8
  • 35
  • 40
theRoot
  • 571
  • 10
  • 33
  • For EDIT 1: use `enteredText = doc.addrfield(0)` - see my comment below my answer – Knut Herrmann Jan 20 '15 at 18:35
  • 1
    For EDIT 2: there is no create table in Notes. You just create a document and set the items (=fields) you like. Usually you create a form with fields and create the document based on that form. But you can also create a document with Notes classes. Notes is a non-relational document based database. Look here for more: http://www.nsftools.com/misc/WhatIsNotes.htm – Knut Herrmann Jan 20 '15 at 19:46

1 Answers1

2

You have to use the LotusScript Notes classes to

  • get the current open UI document
  • get the corresponding back-end document
  • set the item (=field)

Your example would look like this then:

Sub Click(Source As Button)
    Dim  myText As String
    Dim workspace As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
    Dim doc As NotesDocument
    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.myField = myText
End Sub

You could use doc.ReplaceItemValue instead. It gives you a bit more flexibility.

The Designer help file itself gives you an introduction to Notes development in chapter "Application Design".

Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67
  • `Msgbox "Data entered in addrfield : "+ doc.[addrfield]text` how to retrieve from a text field – theRoot Jan 20 '15 at 18:06
  • 1
    It's `Msgbox "Data entered in addrfield : "+ doc.addrfield(0)`. `doc.addrfield` returns a text list and with `doc.addrfield(0)` you get the first and in this case only element. – Knut Herrmann Jan 20 '15 at 18:28
  • @Kunt I have updated the ques regarding DB,Looking for your response. – theRoot Jan 20 '15 at 19:36