need to get WareHouse lookup based on "ItemType", which needs to match InventLocation "ItemType"

While creating SalesOrder, need to get WareHouse lookup based on "ItemType",
which needs to match InventLocation "ItemType"

step 1: Add new field in "InventLocation" Table and drag field in particular form level.
Step 2: In SalesCreateOrder form -> Datasource -> SalesTable -> Fields -> InventLocationId -> Lookup( )
        public void lookup(FormControl _formControl, str _filterStr)
       {   
         SysTableLookup          sysTableLookup = SysTableLookup::newParameters(tableNum(InventLocation),_formControl);
         Query                   query = new Query();
         QueryBuildDataSource    queryBuildDataSource = query.addDataSource(tableNum(InventLocation));
   
        queryBuildDataSource.addRange(fieldNum(InventLocation, ItemType)).value(queryValue(salesTable.ItemType));
        sysTableLookup.addLookupfield(fieldNum(InventLocation, InventLocationId));
        sysTableLookup.addLookupfield(fieldNum(InventLocation,Name));
        sysTableLookup.addLookupfield(fieldNum(InventLocation,InventSiteId));
        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