I am using PXFormula to multiply a qty and cost to create a new extension field in the details of Physical Inventory Review (although I would think the specific screen wouldn’t matter.) That part is working fine. However, I then want to sum that new column’s values into a new extension field in the header. I can't get that part to work.
Here is the relevant detail code:
using PX.Data;
using System;
namespace PX.Objects.IN
{
public class INPIDetailExt : PXCacheExtension<PX.Objects.IN.INPIDetail>
{
#region UsrExtBookCost
bPXDecimal]
cPXUIField(DisplayName="Ext. Book Cost")]
BPXFormula(typeof(Mult<INPIDetail.bookQty, INPIDetail.unitCost>),
typeof(SumCalc<INPIHeaderExt.usrTotalBookCost>))]
public virtual Decimal? UsrExtBookCost { get; set; }
public abstract class usrExtBookCost : PX.Data.BQL.BqlDecimal.Field<usrExtBookCost> { }
#endregion
}
}
Here’s the header code:
using PX.Data;
using System;
namespace PX.Objects.IN
{
public class INPIHeaderExt : PXCacheExtension<PX.Objects.IN.INPIHeader>
{
#region UsrTotalBookCost
PPXDecimal]
{PXUIField(DisplayName="Total Book Cost")]
public virtual Decimal? UsrTotalBookCost { get; set; }
public abstract class usrTotalBookCost : PX.Data.BQL.BqlDecimal.Field<usrTotalBookCost> { }
#endregion
}
}
I feel it has something to do with the fact that these are extensions and that somehow the PXParent that is called in INPIDetail does not cover these extension.