Dear all,
I return the converted unit value with below code. But once I select the warehouse while opening the form InventOnHandItemListPage its returns converted value from all warehouses. I need converted unit value based on my warehouse selection only. Please let me know How can I achieve this.
//code on InventTableModule public display InventQty availPhyQty() { InventSum inventSum; InventDim inventdim; InventTable inventTable; InventQty Qty; Qty _salesQty; SalesLine _salesLine; real value; UnitOfMeasureFromRecId fromUnitOfMeasure; UnitOfMeasureToRecId toUnitOfMeasure; fromUnitOfMeasure = UnitOfMeasure::findBySymbol("PC").RecId; toUnitOfMeasure = UnitOfMeasure::findBySymbol(this.UnitId).RecId; while select inventSum where inventSum.ItemId == this.ItemId { //select inventdim //where inventdim.inventDimId == _inventDimId; //if(inventdim.InventSiteId == this.inventDim().InventSiteId && inventdim.InventLocationId == this.inventDim().InventLocationId) Qty += inventSum.physicalInventCalculated(); } if (UnitOfMeasureConversion::findByConversion(fromUnitOfMeasure, toUnitOfMeasure) || UnitOfMeasureConversion::findByConversion(toUnitOfMeasure, fromUnitOfMeasure)) { _salesQty = UnitOfMeasureConverter::convert(Qty, fromUnitOfMeasure, toUnitOfMeasure, NoYes::No, 0, NoYes::No); return _salesQty; } else { return Qty; } } //code on InventSum to return above value Public display InventQty availPhyQty() { return InventTableModule::find(this.ItemId, ModuleInventPurchSales::Purch).availPhyQty(); }
Thanks
Faqru
*This post is locked for comments