Hi Folks,
After a long gap due to busy schedule..
Today,Lets learn small trick ,how to disable filter in lookup code in Ax2012
After a long gap due to busy schedule..
Today,Lets learn small trick ,how to disable filter in lookup code in Ax2012
public void
lookup(FormControl _formControl, str
_filterStr)
{
SysTableLookup sysTableLookup;
Query query;
QueryBuildDataSource qbds;
QueryBuildRange qbr;
//super(_formControl,
_filterStr);
sysTableLookup = SysTableLookup::newParameters(tableNum(InventTable),_formControl);
sysTableLookup.addLookupfield(fieldNum(InventTable,ItemId));
sysTableLookup.addLookupfield(fieldNum(InventTable,NameAlias));
sysTableLookup.addLookupfield(fieldNum(InventTable,ItemType));
query = new
Query();
qbds
= query.addDataSource(tableNum(InventTable));
qbr
= qbds.addRange(fieldNum(InventTable,ItemType));
qbr.value(enum2str(ItemType::Service));
qbr.status(RangeStatus::Hidden); //Itemtype Filter disable
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
I was Searching for this range filter on lookups and you made it simple.
ReplyDeleteBut is not working for Gender field .. it is just working for a normal string field like I use for my StudentId in this way
Deleteqbr.value("S001")