如何指定代理/公式以按条件检索文档 [英] How to specify agent / formula to retrieve documents by criteria

查看:103
本文介绍了如何指定代理/公式以按条件检索文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该表单包含"searchInputField"和用于它的简单按钮.在按钮下方,有一个视图.

The form contains "searchInputField" and simple button for it. Below the button, there is a view.

如何根据searchInputCriteria在VIEW中指定SELECT公式?我想在设置"searchInputField"后单击按钮时刷新VIEW.它应该像简单的自定义搜索.

How can i specify SELECT formula in VIEW according to searchInputCriteria? I want to refresh VIEW when button is clicked after setting "searchInputField". It should be like simple custom search.

在按钮上单击我已完成:

On button click i have done:

@SetEnvironment("criteria", "searchInputField");
@Command([RunAgent];"searchAgent");
@Command([ViewRefreshFields]);

我的经纪人这样做:

SELECT @Like(propertyA, @Environment("criteria"));

但是它什么也没做.我是Lotus Notes的新手.请给我一些指导

But it doesn't do anything. I'm new to Lotus Notes. Please, give me some guidelines

预先感谢

推荐答案

您可以在按钮内使用此脚本,但无法以动态,实时的方式工作:

You could use this script inside your button but it won't work in a dynamic, real-time way:

Dim db As NotesDatabase
Dim session As New NotesSession
Dim uiw As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim formula As String
Dim doc As NotesDocument
Dim view As NotesView       
Set db=session.CurrentDatabase
Set uidoc=uiw.CurrentDocument
Set doc=uidoc.Document
Set view=db.GetView("MyEmbeddView")     
formula$={SELECT  @Like(criteria;  "} & doc.searchInputField(0) & {")}
view.SelectionFormula=formula

以可靠的方式查看更改的唯一方法是关闭并重新打开数据库.就性能而言,这也是一种非常昂贵的工作方式. 我建议您不要使用这种方式来即时"更改视图选择.更改在更改后的一段时间内保持静态的视图可能会很有用.例如,您可以编写一个代理来定期更改选择公式(例如,每月或每天在非高峰时间或在维护时段内).

The only way to see the changes in a reliable way is to close and reopen the database. It's also a very expensive way of working in terms of performance. I advise you not to use this way of working to change view selections 'on the fly'. It can be useful to change views that stay static for a while after the change. For example you could write an agent that changes the selection formulas on a periodic basis (e.g., monthly or daily at a non-peak time or during a maintenance window).

在您的情况下,我建议您使用单一类别视图或动态填充文件夹. 与动态计算用于填充文件夹的DocumentCollection相比,单类别视图的工作速度要快得多.

In your case I advise using single category views or to populate a folder on the fly. Single category views will work much faster than dynamically calculating the DocumentCollection used to populate a folder.

这篇关于如何指定代理/公式以按条件检索文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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