莲花笔记,搜索等于文本框的数据 [英] lotus notes, search data that equal to textbox

查看:73
本文介绍了莲花笔记,搜索等于文本框的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白为什么不允许我的代码.

I don't understand why my code is not allowed.

@If(@DbLookup("":"nocache";@DbName;"GPA";1)="GPnum";@Failure(@Command([FileSave])&@Command([CloseWindow]));@Success)`

请帮助我.谢谢.

推荐答案

我为按钮操作添加了一个代码,用于保存当前文档(请参见下面的作者评论)
用户在其中输入我们检查的值的可编辑字段称为GPnum.视图"GPA"按其第一列显示的GPnum值进行排序.

I add a code for button action that save the current doc (see author comment below)
The editable field in which the user enters the value we check is called GPnum. A view "GPA" is sorted by its first col an display GPnum value.

t:=@DbLookup("":"nocache";@DbName;"GPA"; GPnum ; 1 ; [FailSilent] );
@If(@IsError(t) ; @Prompt([Ok]; "DB has a problem:";@Text(t)) ;
  t = "" ; @Do(@Command([FileSave]);@Command([CloseWindow])) ;
  @Prompt([Ok] ; "unable to save" ; "The key already exists") )

原始回复

t:=@DbLookup("":"nocache";@DbName;"GPA"; @ThisValue ; 1 );
@If(@IsError(t) ; @Failure("DB has a problem:"+@Text(t)) ; t =  "" ; @Success ; @Failure("The key already exists") )

如果使用@ failure/@ success,则必须以表格(验证)形式位于可编辑字段中. 据我了解,您检查您的值是否已经存在. 所以:

If you use @failure/@success you MUST be in an editable field in a form (validation). As I understand you check that your value does not ALREADY exists. so:

首先添加@thisValue作为您在DBLOOKUP中搜索的键, 如上所述,DBLOOKUP可能返回错误,因此请检查@isError(t)
第二次失败只是阻止了表单的验证,我从未尝试过(没有任何意义)使其保存表单

first add @thisValue as the key you search in the DBLOOKUP, as told above DBLOOKUP could return an error thus check @isError(t)
second failure just BLOCK the validation of the form, I never tried (an it doesn't make sense) to make it save the form

希望有帮助

这篇关于莲花笔记,搜索等于文本框的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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