自定义查找选择问题 [英] Custom lookup select issue

查看:70
本文介绍了自定义查找选择问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个想法是用唯一的雇主名构造一个查找. 查找工作正常,但是当我选择一个值然后选择查找按钮时 再次单击红色中标记的位置,存在重复的值,这是错误的.

The idea is to contruct a lookup with unique Employer name. The lookup works fine but when I select a value and then select the lookup button again and click on the place marked in RED, there are duplicate values, which is wrong.

请参考代码段和快照

QueryBuildDataSource    qbds;
Query                   query = new Query();
FormStringControl       control = dialog.formRun().controlCallingMethod();
SysTableLookup          sysTableLookup =  SysTableLookup::newParameters(tablenum(VendTable), control);
;

qbds  = query.addDataSource(tablenum(VendTable));
qbds.addGroupByField(fieldnum(VendTable,EmployerName));
sysTableLookup.addLookupfield(fieldnum(VendTable, EmployerName));

sysTableLookup.parmQuery(query);
sysTableLookup.parmUseLookupValue(false);
sysTableLookup.performFormLookup();

2

推荐答案

对表VendTable和字段EmployerName 以及RecId计数进行查看,然后基于该视图进行查找

Make a view on table VendTable and field EmployerName and a count of RecId, then base the lookup on the view.

如下所示CustTableCustGroup:

这篇关于自定义查找选择问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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