// VAR Changed on 24 四月 2012 at 10:41:52 by Jimmy Xie
static void THK_FilterOrFindOnFormMethod(Args _args)
{
/*
Adding Find\Filter functionality on Display method
Override Context method of Form control which is using display method and provide code for filter.
E.g I have done below for PhysicalInvent field of InventOnHandItem form.
*/
void context()
{
int selectedMenu;
real test;
formrun fr;
Args ag;
Itemname strtext;
query q;
queryrun qr;
queryBuildDataSource qbds;
PopupMenu menu;// = new PopupMenu(element.hWnd());
int a = menu.insertItem('Find');
int b = menu.insertItem('Filter');
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)
{
q = inventSum_Ds.query();
qbds = q.dataSourceTable(tablenum(InventSum));
qbds.addRange(FieldNum(InventSum,PhysicalInvent)).value(SySQuery::value(strtext));
inventSum_Ds.query(Q);
inventSum_Ds.executeQuery();
}
break;
case b:
InventSum_DS.filter(FieldNum(InventSum,PhysicalInvent),Sysquery::value(InventSum.PhysicalInvent()));
break;
case c :
InventSum_DS.removeFilter();
break;
Default:
break;
}
}
}
没有评论:
发表评论