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

We will follow the following steps in the AX development.

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

How to retrieve multiple selected records from Grid using X++