I have created a customization to add the Item Status to the SOLine. The graph code and DAC compile just fine and give no errors. When I check the new field of status it is just blank. Here is how I went about this:
First the DAC:
public class SOLineExt : PXCacheExtension<PX.Objects.SO.SOLine>
{
#region ItemStatus
public abstract class itemStatus : PX.Data.IBqlField
{
}
protected string _ItemStatus;
[PXString()]
[PXDefault()]
[PXUIField(DisplayName = "Status", IsReadOnly = true)]
public virtual string ItemStatus
{
get
{
return this._ItemStatus;
}
set
{
this._ItemStatus = value;
}
}
#endregion
}
Graph:
public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
#region Event Handlers
protected void SOLine_RowSelecting(PXCache cache, PXRowSelectingEventArgs e,PXRowSelecting InvokeBaseHandler)
{
if(InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (SOLine)e.Row;
if (row == null) return;
InventoryItem item = PXSelect<InventoryItem, Where<InventoryItem.inventoryID, Equal<Required<SOLine.inventoryID>>>>.Select(Base, row.InventoryID);
if(item != null){
SOLineExt soLinesExt = row.GetExtension<SOLineExt>();
if (soLinesExt != null){
if (item.ItemStatus == 'AC')
soLinesExt.ItemStatus = "Active";
if (item.ItemStatus == 'NS')
soLinesExt.ItemStatus = "No Sales";
if (item.ItemStatus == 'NP')
soLinesExt.ItemStatus = "No Purchases";
if (item.ItemStatus == 'NR')
soLinesExt.ItemStatus = "No Request";
if (item.ItemStatus == 'IN')
soLinesExt.ItemStatus = "Inatctive";
if (item.ItemStatus == 'DE')
soLinesExt.ItemStatus = "Marked for Deletion";
}
}
}
#endregion
}
I have used a similar method for this to add other fields onto grids, it's just this field in particular I'm having trouble with. Noticed that I do want the full status name to show instead of just the two character code.