按钮单击事件-Lotus Script [英] Button Click Event - Lotus Script
问题描述
我想为按钮单击事件使用适当的Lotus脚本,该脚本在单击时弹出一个可供选择的工作人员关键字列表,并将其放置在superior1字段上...我不确定要提供的参数...请帮助我那...我遵循下面的脚本,但没有用...在一个空的对话框列表中显示...:(...或者为我提供一个替代公式或sumthin来解决这个问题...很多...
I want proper lotus script for button click event that on click pops out a keyword list of staff to select and place on the superior1 field... I am not sure of the parameters to be given... please help me with that... I followed the below script and it didnt work... it is showin an empty dialog list...:(... or else provide me an alternative formula or sumthin to work this out... thx a lot...
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 ... :)我已经把pickliststrings弄乱了,我已经想要了wat,即要显示按组列分类的Superior1关键字列表... foll是我使用的脚本tat ...
Thx a lot Hristo & mbonaci...:) I've wrked out with the pickliststrings and i've got wat i wanted i.e to display a list of superior1 keywords categorized by group column... foll is the script tat i used ...
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
现在,从列表中选择任何关键字...例如:执行"将放置在当前文档/表单的"Superior1"字段中……对此脚本很感兴趣……请帮助我...
Now, on selectin any keyword from the list... for eg: "Executive" shud be placed on the field "Superior1" of the current document/form... wazz the script for this... plz help me...
推荐答案
如所写,PickListStrings
应该导致错误,因为在第七个位置缺少参数-prompt$
(帮助PickListStrings )和Notes不能使用数字(在这种情况下为4)作为参数.
As written, the PickListStrings
should result in an error, because there is a missing argument on the seventh position - the prompt$
(help for PickListStrings) and Notes does not expect a number (4 in this case) as an argument.
除此之外:
- 您是否尝试过打开目标视图("Master \ ASEAN_Staff.nsf"中的"x_asean_search")并从字段
Superior1
(您测试的值)中键入字符串以确保存在此类?如果视图中存在焦点,则应将焦点移到该类别. - 尝试在状态栏中打印
Sup1$
,以确保它包含期望值. - 视图的第四列是否是该列,您要返回哪些值?
- Have you tried opening the target view ("x_asean_search" in "Master\ASEAN_Staff.nsf") and typing the string from field
Superior1
(the value you test with) to make sure there is such category? The focus should move to that category, if it exists in the view. - Try printing the
Sup1$
in the status bar to make sure it contains the expected value. - Is the fourth column of the view the one, which values you want to return?
不会引起问题,但是请牢记:
Not causing a problem, but good to keep in mind:
-
Dim view,view1 As NotesView
声明类型为Variant
的变量view
和类型为NotesView
的view1
.将它们放在单独的行上,以避免发生意外行为的可能性.例如,这里的语句If (view is Nothing) Then
将导致类型不匹配"错误. -
If Superior1= "" Then
中的变量Superior1
似乎是带有值EMPTY的变量,因此条件始终为true.使用Option Declare
是一种很好的做法,可以防止它编译.</li>
Dim view,view1 As NotesView
declares variableview
of typeVariant
andview1
of typeNotesView
. Put them on separate lines to avoid the possibility of unexpected behavior. For example, here a statementIf (view is Nothing) Then
will result in a "Type Mismatch" error.- The variable
Superior1
fromIf Superior1= "" Then
seems to be a variant with value EMPTY, so the condition is always true. UsingOption Declare
is a good practice that would prevent this from compiling.
这篇关于按钮单击事件-Lotus Script的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!