Template For Usage Of PXLineNbr Attribute In Acumatica
18 May 2020
Hello everybody,
today I want to leave a note on how to use PXLineNbr attribute in Acumatica pages. Recently myself and one of my team members struggled a bit with a question on how to add it properly. Below goes a bit changed worked tempalte:
public class PrimaryTable : IBqlTable { #region LineId public abstract class lineId : PX.Data.BQL.BqlInt.Field<lineId> { } [PXDBInt] [PXDefault(0)] public virtual int? LineId { get; set; } #endregion #region LineCntr public abstract class lineCntr : PX.Data.BQL.BqlInt.Field<lineCntr> { } [PXDBInt] [PXDefault(0)] public virtual int? LineCntr { get; set; } #endregion } public class DetailsTable : IBqlTable { #region LineNbr public abstract class lineNbr : IBqlField { } [PXDBInt(IsKey = true)] [PXDefault] [PXLineNbr(typeof(PrimaryTable.lineCntr))] [PXParent(typeof(SelectFrom<PrimaryTable>.Where<PrimaryTable.lineId.IsEqual<PrimaryTable.lineId .FromCurrent>>))] public virtual int? LineNbr { get; set; } #endregion }
Summary
As you see, nothing special in this code. Add PXParent, PXLineNbr and enjoy with line counter feature.