Wednesday, May 4, 2011

Show Not Invoiced PO in LookUp

Hi Friends,

In Lookup I want to show PO Numbers whose status is not Invoiced.
Here is the Code:
Form - Desing - StringEdit Control - 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));
sysTableLookup.addLookupfield(fieldnum(PurchTable, PurchName));
sysTableLookup.addLookupfield(fieldnum(PurchTable,PurchStatus));
queryBuildDataSource.addRange(fieldnum(PurchTable, PurchStatus)).value(enum2str(PurchStatus::Backorder));
queryBuildDataSource.addRange(fieldnum(PurchTable, PurchStatus)).value(enum2str(PurchStatus::Received));
queryBuildDataSource.addRange(fieldnum(PurchTable, PurchStatus)).value(enum2str(PurchStatus::Canceled));
queryBuildDataSource.addRange(fieldnum(PurchTable, PurchStatus)).value(enum2str(PurchStatus::None));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}

No comments:

Post a Comment

Leave your comments and solutins