如何为Domino Designer访问Lotus脚本中的文本字段值 [英] how to access textfield value in lotus script for Domino designer

查看:94
本文介绍了如何为Domino Designer访问Lotus脚本中的文本字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Domino设计师和Lotus脚本的新手,

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

但显示错误:

命名产品字段不存在

named product field does not exist

为此进行了Google搜索,但找不到解决方案.

Googled for it but can't find the solution.

再一次,搜索了在domino Designer中为初学者创建表单,视图,数据库的教程.但找不到一个.

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.

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

@Knut 在Domino Designer中,如何创建数据库表? 我的意思是类似创建表<tablenam> (field1,feild2,..);
我该如何访问它.我引用了.这个家伙向我展示了如何连接数据库,但没有展示如何创建数据库表.

@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.

推荐答案

您必须使用LotusScript Notes类

You have to use the LotusScript Notes classes to

  • 获取当前打开的UI文档
  • 获取相应的后端文档
  • 设置项目(=字段)

那么您的示例将如下所示:

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

您可以使用 doc.ReplaceItemValue .它为您提供了更多的灵活性.

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

Designer帮助文件本身在应用程序设计"一章中为您介绍了Notes开发.

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

这篇关于如何为Domino Designer访问Lotus脚本中的文本字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆