Feature.xml changes are not showing in Enable/Disable custom feature UI?

只愿长相守 提交于 2020-04-30 06:48:46

问题


Add custom feature checkbox is not showing in custom feature UI, My finding

var featureAttributes = cache.GetAttributes(null, field).OfType<FeatureAttribute>();

giving 0 featureAttributes, that's-why it is not visible while i have added Features.xml file with proper tag as suggested in documentation, any thing else am i missing?


回答1:


All you should need is the table extension for the FeatureSet table. Here is an example:

public sealed class FeaturesSetExtension : PXCacheExtension<PX.Objects.CS.FeaturesSet>
{
    #region UsrMyNewFeature
    public abstract class usrMyNewFeature : PX.Data.BQL.BqlBool.Field<usrMyNewFeature> { }

    [Feature(false, DisplayName = "MY NEW FEATURE")]
    public bool? UsrMyNewFeature { get; set; }
    #endregion
}

I end up with the following:

You will create a Feature.xml file to then limit pages related to the new feature switch.

If you need to access the switch (which might not register until added into the features.xml):

PXAccess.FeatureInstalled<FeaturesSetExtension.usrMyNewFeature>()



回答2:


  1. Feature.XML should be in root of our Project.
  2. Attribute [Feature(false, DisplayName = "MY NEW FEATURE")], should always be there.
  3. If want to see "MY NEW FEATURE" under a root then look at below code.

    region UsrMyNewFeature

    public abstract class usrMyNewModuleFeature : PX.Data.BQL.BqlBool.Field { }

    [Feature(false, DisplayName = "MY Module FEATURE")] public bool? UsrMyNewModuleFeature { get; set; }

    endregion

    region UsrMyNewFeature

    public abstract class usrMyNewFeature : PX.Data.BQL.BqlBool.Field { }

    [Feature(false, typeof(usrMyNewModuleFeature), DisplayName = "MY NEW FEATURE")] public bool? UsrMyNewFeature { get; set; }

    endregion



来源:https://stackoverflow.com/questions/61212354/feature-xml-changes-are-not-showing-in-enable-disable-custom-feature-ui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!