Skip to main content

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 stringw]
{
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 stringw]
{
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.

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


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 stringr]
{
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
}
}

 


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


Reply