mercredi 22 juin 2011

How to Avoid Null values in Lookup

If you don't want to show Null Values in a lookup list
The below code avoid Null Values in Lookup.

public void lookup()
{
PurchTable purchTable;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(PurchTable), this);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource = query.addDataSource(tablenum(PurchTable));
;
sysTableLookup.addLookupfield(fieldnum(PurchTable, PurchId));

queryBuildDataSource.addRange(fieldnum(PurchTable, PurchId)).value("000010..000020");
//To avoid the null values in Dynamic lookup
//queryBuildDataSource.addRange(fieldnum(Test_Vend,Name)).value(SysQuery::valueNotEmptyString());
//queryBuildDataSource.addRange(fieldnum(Test_Vend,Name)).value('!="" ');
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}

Aucun commentaire:

Enregistrer un commentaire