When I create a FeaturesSetExt to introduce a new Feature Flag, the new Field on the database is initialized with NULL.
Even though I set the PXDefault to false (I know this is redundant), I have trouble activating other Features, if my new feature was not activated and is still NULL, I always get the error “’MyFeature’ cannot be empty”.
public sealed class FeaturesSetExt : PXCacheExtension<FeaturesSet>
{
public static bool IsActive() => true;
#region UsrMyFeature
[PXDefault(false, PersistingCheck = PXPersistingCheck.Nothing)]
[Feature(false, typeof(FeaturesSet.subAccount), DisplayName = "UsrMyFeature" )]
public bool? UsrMyFeature{ get; set; }
public abstract class usrMyFeature: BqlBool.Field<usrMyFeature> { }
#endregion
}
I solved it by adding an SQL UPDATE script to my customization that initializes the field with False. But it doesn’t look like the best solution.
Do you have ideas on how to solve this?