我想要按钮点击事件的正确莲花脚本,点击弹出一个关键字列表的工作人员选择并放置在superior1字段...我不确定要给出的参数...请帮助我那...我按照下面的脚本,它没有工作...它显示一个空的对话框列表... :( ...或者给我一个替代的公式或总结来解决这个问题......很多......
Sub Click(Source As Button)
Dim session As New notessession
Dim view,view1 As NotesView
Dim doc,doc1 As notesdocument
Dim db As Notesdatabase
Set db=session.CurrentDatabase
Dim Overdb As notesdatabase
Set Overdb=session.GetDatabase(db.server, "Master\\ASEAN_Staff.nsf")
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim picklist As Variant
Set uidoc = workspace.CurrentDocument
If Superior1= "" Then
Sup1$ = uidoc.FieldGetText("Superior1")
picklist = workspace.PickListStrings( PICKLIST_CUSTOM,_
False,_
db.server,_
"Master\\ASEAN_Staff.nsf",_
"x_asean_search",_
"Select Name",_
4,_
Sup1$ )
End If
End Sub
很多Hristo& mbonaci ... :)我已经找到了挑选列表,我已经得到了我想要的ie即显示按组列分类的superior1关键字列表... foll是我使用的脚本...
Sub Click(Source As Button)
Dim session As New notessession
Dim view As NotesView
Dim view1 As notesview
Dim doc,doc1 As notesdocument
Dim db As Notesdatabase
Set db=session.CurrentDatabase
Dim Overdb As notesdatabase
Set Overdb=session.GetDatabase(gsserver, gspath + "Master\\ASEAN_Staff.nsf")
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim picklist As Variant
Set uidoc = workspace.CurrentDocument
If Superior1= "" Then
'Sup1 = uidoc.FieldGetText("Superior1")
'Ofc = uidoc.FieldGetText("Office")
Gp = uidoc.FieldGetText("Group")
'og = doc.Office + doc.Group
picklist = workspace.PickListStrings( PICKLIST_CUSTOM,_
False,_
gsserver,_
"Master\\ASEAN_Staff.nsf",_
"x_asean_search",_
"Select Name",_
"Choose",_
1,_
Gp )
End If
End Sub
现在,在selectin列表中的任何关键字...例如:“执行”shud放在当前文档/表单的字段“Superior1”...为此脚本wazz ... plz帮助我......
答案 0 :(得分:1)
如上所述,PickListStrings
应该会导致错误,因为第七个位置上缺少一个参数 - prompt$
(help for PickListStrings)而Notes不期望一个数字(在这种情况下为4)作为论据。
除此之外:
Superior1
(您测试的值)中键入字符串以确保存在此类别?如果视图中存在焦点,焦点应移至该类别。Sup1$
以确保其中包含预期值。没有引起问题,但请记住:
Dim view,view1 As NotesView
声明类型view
的变量Variant
和view1
类型的NotesView
。将它们放在不同的行上以避免意外行为的可能性。例如,此处语句If (view is Nothing) Then
将导致“类型不匹配”错误。Superior1
的变量If Superior1= "" Then
似乎是值为EMPTY的变量,因此条件始终为true。使用Option Declare
是一种很好的做法,可以防止编译。答案 1 :(得分:0)
为什么不简单地使用带有@DbColumn公式的Dialog list字段作为选项(字段属性的第二个选项卡):
@DbColumn( class : cache ; server : database ; view ; columnNumber )
示例:
@DbColumn( "ReCache"; ""; "x_asean_search"; 4 )
将返回当前数据库“x_asean_search”视图的第四列中的所有值。