
How to save currentCost filed in Database ?
This CurrentCost Filed is custom filed
/* DAC */
namespace PX.Objects.IN
{
public class INItemCostExt : PXCacheExtension<PX.Objects.IN.INItemCost>
{
public static bool IsActive() => true;
#region UsrCurrentCost
[PXDBPriceCost(BqlField = typeof(INItemCostExt.usrCurrentCost))]
[PXUIField(DisplayName = "Current Cost")]
[CurySymbol]
public virtual Decimal? UsrCurrentCost { get; set; }
public abstract class usrCurrentCost : PX.Data.BQL.BqlDecimal.Field<usrCurrentCost> { }
#endregion
}
}
/* InventoryItemMaint_Extension */ Bussiness Logic
;
namespace PX.Objects.IN
{
public class InventoryItemMaint_Extension : PXGraphExtension<PX.Objects.IN.InventoryItemMaint>
{
public static bool IsActive() => true;
#region Event Handlers
protected void INItemCost_RowInserted(PXCache cache, PXRowInsertedEventArgs e, PXRowInserted InvokeBaseHandler)
{
if (InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
INItemCost row = (INItemCost)e.Row;
INItemCostExt itemCostExt = row.GetExtension<INItemCostExt>();
}
protected void INItemCost_RowPersisted(PXCache cache, PXRowPersistedEventArgs e, PXRowPersisted InvokeBaseHandler)
{
if (InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
INItemCost row = (INItemCost)e.Row;
INItemCost INItemCost = (INItemCost)Base.ItemCosts.Cache.Current;
INItemCostExt itemCostExtBase = INItemCost.GetExtension<INItemCostExt>();
}
protected void INItemCost_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e, PXRowUpdated InvokeBaseHandler)
{
if (InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
INItemCost row = (INItemCost)e.Row;
INItemCostExt itemCostExt = row.GetExtension<INItemCostExt>();
INItemCost INItemCost = (INItemCost)Base.ItemCosts.Cache.Current;
INItemCostExt itemCostExtBase = INItemCost.GetExtension<INItemCostExt>();
}
#endregion
}
}
Thank You..