I'm trying to implement a custom feature switch in the Enable/Disable Features screen (CS101000).
In my extension library, I added the following code to a new file named FeaturesSetExt.cs:
namespace PX.Objects.CS
{
public class FeaturesSetExt : PXCacheExtension<PX.Objects.CS.FeaturesSet>
{
#region UsrCustomSwitch
[PXDefault(false, PersistingCheck = PXPersistingCheck.Nothing)]
[Feature(false, DisplayName = "Custom Feature")]
public bool? UsrCustomSwitch { get; set; }
public abstract class usrCustomSwitch : PX.Data.BQL.BqlBool.Field<usrCustomSwitch> { }
#endregion
}
}
I also added a new Features.xml file with the following content:
<?xml version="1.0" encoding="utf-8"?>
<Features Type="MyExtLibrary.FeaturesSetExt" Key="0">
<Feature Name="UsrCustomSwitch">
<Access ScreenID="SA101000"/>
<Access ScreenID="SA201000"/>
<Access ScreenID="SA401000"/>
<Access ScreenID="SA501000"/>
<Access ScreenID="SA502000"/>
<Access ScreenID="SA503000"/>
</Feature>
</Features>
I set the Build Action of Features.xml to Embedded Resource.
The project builds successfully, and I published the customization project.
However, when I navigate to the Enable/Disable Features screen, I receive the following error:
Invalid column name '[FeaturesSet].[UsrCustomSwitch]'
Am I did anything wrong? Or missed something ?
any help would be appreciated .
Thank you
