如何访问 Domino 设计器的 Lotus 脚本中的文本字段值
how to access textfield value in lotus script for Domino designer
我是 Domino 设计器和 Lotus 脚本的新手,
我试图通过以下方式访问我的文本字段:
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
但是显示错误:
named product field does not exist
用谷歌搜索但找不到解决方案。
还有一个,搜索了在多米诺设计器中为初学者创建表单、视图、数据库的教程。但是找不到。
如果可能,请提供教程网站的链接。
编辑 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
错误:
Object variable not set
编辑 2:
@克努特
在 Domino Designer 中,如何创建数据库 tables?
我的意思是像 create table <tablenam> (field1,feild2,..)
;
我怎样才能访问它。我提到了 this。这家伙向我展示了如何连接到数据库,但没有展示如何创建数据库 table。
您必须使用 LotusScript Notes 类 才能
- 获取当前打开的UI文档
- 获取对应的后台文档
- 设置项目(=字段)
您的示例将如下所示:
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
您可以改用 doc.ReplaceItemValue。它给了你更多的灵活性。
Designer help file 本身在 "Application Design" 章中为您介绍了 Notes 开发。
我是 Domino 设计器和 Lotus 脚本的新手,
我试图通过以下方式访问我的文本字段:
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
但是显示错误:
named product field does not exist
用谷歌搜索但找不到解决方案。
还有一个,搜索了在多米诺设计器中为初学者创建表单、视图、数据库的教程。但是找不到。
如果可能,请提供教程网站的链接。
编辑 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
错误:
Object variable not set
编辑 2:
@克努特
在 Domino Designer 中,如何创建数据库 tables?
我的意思是像 create table <tablenam> (field1,feild2,..)
;
我怎样才能访问它。我提到了 this。这家伙向我展示了如何连接到数据库,但没有展示如何创建数据库 table。
您必须使用 LotusScript Notes 类 才能
- 获取当前打开的UI文档
- 获取对应的后台文档
- 设置项目(=字段)
您的示例将如下所示:
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
您可以改用 doc.ReplaceItemValue。它给了你更多的灵活性。
Designer help file 本身在 "Application Design" 章中为您介绍了 Notes 开发。