Need to provide “ItemId lookup” based on "ItemType" field, which selected while creating SalesOrder

In SalesTable form – Need to provide “ItemId lookup” based on "ItemType" field,
 which selected while creating SalesOrder

In SalesTable Form -> Datasource -> Salesines -> Fields -> ItemID -> Lookup( )

    SysTableLookup          sysTableLookup = SysTableLookup::newParameters(tableNum(InventTable),_formControl);
    Query                   query = new Query();
    QueryBuildDataSource    queryBuildDataSource = query.addDataSource(tableNum(InventTable));
   
    queryBuildDataSource.addRange(fieldNum(InventTable, ItemType)).value(queryValue(salesTable.ItemType));
    sysTableLookup.addLookupfield(fieldNum(InventTable,ItemId));
    sysTableLookup.addLookupMethod(tableMethodStr(InventTable,defaultProductName));
    sysTableLookup.addLookupMethod(tableMethodStr(InventTable,itemGroupId));
    sysTableLookup.addLookupfield(fieldNum(InventTable,NameAlias));
    sysTableLookup.addLookupfield(fieldNum(InventTable,ItemType));
    sysTableLookup.addSelectionField(fieldNum(InventTable,Product));
    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();

Comments

Popular posts from this blog

In CustCreditLimit class need to check the salesqty to be not more than as given in custom table

Creditinvoice report

Simple string functions to fill in built-in function gaps