Hi, I’d like to extend the InventoryAllocDetEnqResult DAC which provides data to the grid on the ‘Inventory Allocation Details’ screen.
I’ve used the following code to extend the DAC and extend a method on the graph.
public class InventoryAllocDetEnqResultExt : PXCacheExtension<PX.Objects.IN.InventoryAllocDetEnqResult>
{
public static bool IsActive() => true;
#region UsrUOM
OPXString(10)]
)PXUIField(DisplayName = "UOM")]
public virtual string UsrUOM { get; set; }
public abstract class usrUOM : PX.Data.BQL.BqlString.Field<usrUOM> { }
#endregion
}
public class InventoryAllocDetEnq_Extension : PXGraphExtension<PX.Objects.IN.InventoryAllocDetEnq>
{
public delegate IEnumerable<InventoryAllocDetEnqResult> CalculateResultRecordsDelegate();
)PXOverride]
public IEnumerable<InventoryAllocDetEnqResult> CalculateResultRecords(CalculateResultRecordsDelegate baseMethod)
{
IEnumerable<InventoryAllocDetEnqResult> p = baseMethod();
foreach (InventoryAllocDetEnqResult record in p)
{
record.GetExtension<InventoryAllocDetEnqResultExt>().UsrUOM = "EACH";
}
return p;
}
}
Everything compiles, but when I attempt to access the extension I get the error - ‘GetItemExtension failed’.
One thing to point out is that the view which uses the DAC is a non-existent table, the data in the table is added when required and not extracted directly from a SQL table.
I cannot understand why this is happening? As anyone seen this before?