Skip to main content
Solved

Adding User Field to Master Financial Calendar


I need to add a column to the grid of Master Financial Calendar.

I managed to add it but it doesn’t update even if I save it. 

 

 

I checked the table FinPeriod in the database and confirmed that the value is not saved.

 

I already created an Extension Class for both FinPeriod and MasterFinPeriod.

namespace PX.Objects.GL.FinPeriods.TableDefinition
{
    // Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
    public sealed class FinPeriodExt : PXCacheExtension<PX.Objects.GL.FinPeriods.TableDefinition.FinPeriod>
    {
        #region UsrIsFiscalYear
        [PXDBBool]
        [PXUIField(DisplayName = "Is Fiscal Year")]
        [PXDefault(false, PersistingCheck = PXPersistingCheck.Nothing)]
        public bool? UsrIsFiscalYear { get; set; }
        public abstract class usrIsFiscalYear : PX.Data.BQL.BqlBool.Field<usrIsFiscalYear> { }
        #endregion

        #region UsrQuarter
        [PXDBInt()]
        [PXUIField(DisplayName = "Quarter")]
        [PXIntList(
                new int[]
                {
                    Quarters.FirstQuarter,
                    Quarters.SecondQuarter,
                    Quarters.ThirdQuarter,
                    Quarters.FourthQuarter
                },
                new string[]
                {
                    FTSIBIRCustomizations.Messages.FirstQuarter,
                    FTSIBIRCustomizations.Messages.SecondQuarter,
                    FTSIBIRCustomizations.Messages.ThirdQuarter,
                    FTSIBIRCustomizations.Messages.FourthQuarter
                })]

        public int? UsrQuarter { get; set; }
        public abstract class usrQuarter : PX.Data.BQL.BqlString.Field<usrQuarter> { }
        #endregion
    }
}
namespace PX.Objects.GL.FinPeriods
{
    // Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
    public sealed class MasterFinPeriodExt : PXCacheExtension<PX.Objects.GL.FinPeriods.MasterFinPeriod>
    {
        #region UsrIsFiscalYear
        [PXUIField(DisplayName = "Is Fiscal Year")]
        [PXDefault(false, PersistingCheck = PXPersistingCheck.Nothing)]
        public bool? UsrIsFiscalYear { get; set; }
        public abstract class usrIsFiscalYear : PX.Data.BQL.BqlBool.Field<usrIsFiscalYear> { }
        #endregion

        #region UsrQuarter
        [PXUIField(DisplayName = "Quarter")]
        [PXIntList(
                new int[]
                {
                    Quarters.FirstQuarter,
                    Quarters.SecondQuarter,
                    Quarters.ThirdQuarter,
                    Quarters.FourthQuarter
                },
                new string[]
                {
                    FTSIBIRCustomizations.Messages.FirstQuarter,
                    FTSIBIRCustomizations.Messages.SecondQuarter,
                    FTSIBIRCustomizations.Messages.ThirdQuarter,
                    FTSIBIRCustomizations.Messages.FourthQuarter
                })]

        public int? UsrQuarter { get; set; }
        public abstract class usrQuarter : PX.Data.BQL.BqlString.Field<usrQuarter> { }
        #endregion
    }
}

I found out that MasterFinPeriod is PXProjection of FinPeriod but still did not figured out how to make it work. 
 

Can some help me solve my problem? Thank you.

Best answer by daniellepaz

I solved my problem by adding[PXDBInt(BqlTable = typeof(FinPeriod))]  in MasterFinPeriodExt Class.

View original
Did this topic help you find an answer to your question?

3 replies

  • Author
  • Freshman II
  • 3 replies
  • Answer
  • May 8, 2024

I solved my problem by adding[PXDBInt(BqlTable = typeof(FinPeriod))]  in MasterFinPeriodExt Class.


  • Author
  • Freshman II
  • 3 replies
  • May 8, 2024

Here’s the code: 

 

namespace PX.Objects.GL.FinPeriods
{
    // Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
    public sealed class MasterFinPeriodExt : PXCacheExtension<PX.Objects.GL.FinPeriods.MasterFinPeriod>
    {
        #region UsrIsFiscalYear
        [PXDBBool(BqlTable = typeof(FinPeriod))]
        [PXUIField(DisplayName = "Is Fiscal Year")]
        [PXDefault(false, PersistingCheck = PXPersistingCheck.Nothing)]
        public bool? UsrIsFiscalYear { get; set; }
        public abstract class usrIsFiscalYear : PX.Data.BQL.BqlBool.Field<usrIsFiscalYear> { }
        #endregion

        #region UsrQuarter
        [PXDBInt(BqlTable = typeof(FinPeriod))]
        [PXUIField(DisplayName = "Quarter")]
        [PXIntList(
                new int[]
                {
                    Quarters.FirstQuarter,
                    Quarters.SecondQuarter,
                    Quarters.ThirdQuarter,
                    Quarters.FourthQuarter
                },
                new string[]
                {
                    FTSIBIRCustomizations.Messages.FirstQuarter,
                    FTSIBIRCustomizations.Messages.SecondQuarter,
                    FTSIBIRCustomizations.Messages.ThirdQuarter,
                    FTSIBIRCustomizations.Messages.FourthQuarter
                })]

        public int? UsrQuarter { get; set; }
        public abstract class usrQuarter : PX.Data.BQL.BqlString.Field<usrQuarter> { }
        #endregion
    }
}

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2757 replies
  • May 8, 2024

Thank you for sharing your solution with the community @daniellepaz!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings