Hi,
I am trying to customize or filter the Inventory ID Lookup on the Sales Order Screen (SO30100) by using SOLine_InventoryID_CacheAttached. Whenever I select the item, the grid line is filled up with the internal inventory ID value instead of the inventory CD.
Here is my code
public class SOOrderEntry_Extension : PXGraphExtension<PX.Objects.SO.SOOrderEntry>
{
PXMergeAttributes(Method = MergeMethod.Append)]
InventorySelectorCustom(typeof(InventoryItem.inventoryCD))]
protected virtual void SOLine_InventoryID_CacheAttached(PXCache cache)
{
}
Serializable]
public class InventorySelectorCustom : PXCustomSelectorAttribute
{
public InventorySelectorCustom(Type type)
: base(type, typeof(InventoryItem.inventoryCD),typeof(InventoryItem.descr)
, typeof(InventoryItem.itemClassID), typeof(InventoryItem.itemStatus), typeof(InventoryItem.itemType)
, typeof(InventoryItem.baseUnit), typeof(InventoryItem.salesUnit), typeof(InventoryItem.purchaseUnit)
, typeof(InventoryItem.basePrice), typeof(InventoryItem.exportToExternal))
{
}
public virtual IEnumerable GetRecords()
{
SOLine currentItem = (SOLine)this._Graph.Viewse"Transactions"].Cache.Current;
if (currentItem == null)
{
return null;
}
else
{
SOOrder currentOrder = (SOOrder)this._Graph.Viewse"Document"].Cache.Current;
List<InventoryItem> items = new List<InventoryItem>();
var allitems = PXSelect<InventoryItem>.Select(this._Graph);
foreach (var it in allitems)
{
InventoryItem rec = (InventoryItem)it)0];
items.Add(rec);
}
return items;
}
}
}
}