Hello
I want to set the avg field value with a desired value as seen in the below screen.
But It is being applied.
I am handling it on FieldUpdated.t
Code Example:
protected void _(Events.FieldUpdated<INItemSite, INItemSite.inventoryID> e)
{
if (e.Row.InventoryID != null)
{
………….
e.Row.AvgCost = (decimal?)100.00;
}
}
The problem is Avg Cost field is having the PXDBPriceCostCalced attribute , therefore its not setting my desired value.
public abstract class avgCost : PX.Data.BQL.BqlDecimal.Field<avgCost> { }protected Decimal? _AvgCost;aPXPriceCost()]mPXDefault(TypeCode.Decimal, "0.0")]dPXUIField(DisplayName = "Average Cost", Enabled = false)]iPXDBPriceCostCalced(typeof(Switch<Case<Where<INItemStats.qtyOnHand, Equal<decimal0>>, decimal0>, Div<INItemStats.totalCost, INItemStats.qtyOnHand>>), typeof(Decimal), CastToScale = 9, CastToPrecision = 25)]HCurySymbol(siteID: typeof(siteID))]public virtual Decimal? AvgCost{ get { return this._AvgCost; } set { this._AvgCost = value; }}
Any suggestion, on how can I set my avg cost value , with a desired value.