据我所知,ProductName列通过显示方法显示。至少对于我的实现在这里,并且此方法驻留在InventSum表:在 - 库存管理/查询/现场过滤项目名称
display public ItemNameDisplay itemName()
{
// Fields might not have been selected on the specified buffers, or might have been updated since selection
this.checkInvalidFieldAccess(false);
if (this.InventDimId)
{
return this.inventTable().itemName(InventDim::find(this.InventDimId));
}
return this.inventTable().itemName();
}
当我按Ctrl + G,并尝试对数据进行筛选,此选项将是上述列禁用,我觉得出现这种情况是由于该显示方法。有什么办法可以实现这个功能吗?
我应该尝试(右单击)以添加另一个菜单项那里,做一个新的对话框(其中我会记下的项目名称)的帮助下过滤,不知何故,然后在表格上的刷新?
更新1:
我发现和编辑这种做法对我的特殊情况:
public void context()
{
InventTable inventTable;
int selectedMenu;
real test;
formrun fr;
Args ag;
Itemname strtext;
querybuilddataSource qb1;
queryrun qr;
query q;
PopupMenu menu = new PopupMenu(element.hWnd());
int a = menu.insertItem('Find');
int c = menu.insertItem('Remove Filter');
selectedMenu = menu.draw();
switch (selectedMenu)
{
case -1:
break;
case a:
ag = new args('SysformSearch');
fr = new formrun(ag);
fr.run();
fr.wait();
strtext = fr.design().controlName('FindEdit').valueStr();
if(strtext)
{
select ItemId from inventTable
where inventTable.NameAlias == strtext;
InventSum_DS.filter(FieldNum(InventSum,ItemId),Sysquery::value(inventTable.ItemId));
}
break;
case c :
InventSum_DS.removeFilter();
break;
Default:
break;
}
}
不过我觉得不只是显示一个新的PopupMenu的正确方法。我想钩住通常的菜单,并在那里添加新的查找和删除过滤器。而..删除过滤器需要一段时间,我应该以某种方式发信号,以便用户不要惊慌。
是否要按项目名称(如问题中所述)或名称别名(在更新1中实施)进行过滤?这两个领域可能的解决方案是完全不同的。 –
@ FH-Inway,我想过滤项目名称。 –
我似乎无法用这种方式控制事情。如果用户想要获得许多结果,我将不得不添加许多范围,并执行strScan以某种方式检查包含所需字符串的所有值,并且可能该字符串包含*或!等等..我去无处.. –