Hi Everyone,
Today, I’ll show you how to add a new custom feature to the Enable/Disable screen. This feature is useful when implementing a new integration/connector module and a few screens associated with this module.
Below, I have created a sample integration/connector module and developed a couple of screens associated with this module. This custom feature is useful when we want to enable/disable the screens based on the configuration.
Here’s how to do it:
STEP 1: Create a new customization field by extending the FeatureSet DAC
namespace KN.Project
{
public class FeaturesSetExtension : PXCacheExtension<FeaturesSet>
{
#region UsrNewFeature
[Feature(false, null, null, DisplayName = "New Feature")]
[PXUIField(DisplayName = "New Feature")]
public virtual bool? UsrNewFeature { get; set; }
public abstract class usrNewFeature : PX.Data.BQL.BqlBool.Field<usrNewFeature> { }
#endregion
}
}
STEP 2: If you wanted to add this new feature under some other module, (Example: Commerce Module) we need to decorate the Feature DAC with the specific Parent module as seen below.
namespace KN.Project
{
public class FeaturesSetExtension : PXCacheExtension<FeaturesSet>
{
#region UsrNewFeature
[Feature(false, typeof(FeaturesSet.commerceIntegration), null, DisplayName = "New Feature")]
[PXUIField(DisplayName = "New Feature")]
public virtual bool? UsrNewFeature { get; set; }
public abstract class usrNewFeature : PX.Data.BQL.BqlBool.Field<usrNewFeature> { }
#endregion
}
}
- STEP 3: We need to add a Features.xml file, where we can provide the details about the screen IDs to access when this feature is enabled.
- Create a Feature.xml file, making sure it’s the root of your project.
- Right-click on the XML file, go to properties, and select Build Action as “Embedded Resource”.
In the XML file, write a code for the custom screens to “access/restrict” when this feature is enabled/disabled.
Here’s the XML code for reference.
<?xml version="1.0" encoding="utf-8"?>
<Features Type="KN.Project.FeaturesSetExtension" Key="0">
<Feature Name="UsrNewFeature">
<Access ScreenID="AM123456"/>
<Access ScreenID="AM111222"/>
<Access ScreenID="AM112233"/>
</Feature>
</Features>
XML Attributes
- Type = It should be path for FeatureExtension DAC file i.e. KN.Project.FeaturesSetExtension
- Name = Custom Field i.e. UsrNewFeature
- Screen ID = Custom screen IDs (AM123456, AM111222, AM112233)
Disclaimer:
- This customization normally will work with the trial version license, to work with the real Acumatica license, we need to inform to Acumatica add this module/integration in the license and whoever buys this module will get this feature.
I hope this information was helpful and you’re now able to add a new custom feature to the Enable/Disable screen. If you have any questions, comments, or neat tricks to add, please put them in the thread. I’ll get back to you quickly. Thanks for reading my post!
Hi All,
I am working with multiple customization projects,
I have issue when using Export Scenarios,
I want to export data of one customized project screen having some fields from other customized project
but issue is that the fields from second customized project not available in Mapping (source object) when adding Export Scenarios.
Hi Jeff, Please find my comments below.
Q1. When the screen is restricted, can the site map still be hidden? – YES
Q2, I noticed the “disclaimer” you reminded, I hope that CUSTOMIZED pages and fields can be controlled by this function with the real Acumatica license. I can’t just directly publish the customizations to that environment, am I correct? – Yes, if you publish this customization, this feature won’t work until and unless this feature is added to the license by Acumatica.
Hi Nareen,
Thank you for you answers.
For the Q1, could you please teach me how to do it because it did not work for me?
Hi Jeff,
I don’t think we can attach the screenshots here.
Can you please upload your source code to Dropbox/SharePoint and share the link here. I can review it from my end and get back to you ASAP.
Hi Naveen,
I share my Google drive link as below, please let me know if you can’t access it.
https://drive.google.com/drive/folders/19YRJUE6hRrXVjmerRIUU5lOlcjMK_geC?usp=sharing
Hi Jeff,
I’m NOT able to access the above link and requested access.
Could you please provide access and let me know.
Hi Naveen,
Sorry for making you inconvenience.
I enabled the access again, could you please try again.
Hi Naveen,
Did you successfully access and get the file?
Hi Jeff,
Yes, I can access the above link.
Sorry, I was on vacation and I’m back today. I will check and get back to you.
Hi Jeff,
I have worked with your code and it is working for me. Can you please remove the FeatureSetExtension DAC file from DACExtension folder and put the root folder of your project and provide the same path in the XML file and check.
Here is the help guide for more reference – Page Number (149 Page). – https://www.acumatica.com/media/2020/02/AcumaticaERP_CustomizationGuide.pdf
Hi Naveen,
Thank you for your answers and the information provided.
It can finally work now.
I have two further questions.
Q1. When the screen is restricted, can the site map still be hidden?
Q2, I noticed the “disclaimer” you reminded, I hope that CUSTOMIZED pages and fields can be controlled by this function with the real Acumatica license. I can’t just directly publish the customizations to that environment, am I correct?
Hi Naveen,
Thank you for the information provided.
I’ve tried the above steps but it still doesn’t work properly in trial version.
Could you please help me on this?
Thank you.
Hi Jeff,
Hope you have NOT missed the below point
-Right-click on the XML file, go to properties, and select Build Action as “Embedded Resource”.
Hi Naveen,
Thank you for your reply.
I’m pretty sure I didn’t miss the point.
By the way, how do I attach the screenshot in comment?
Hi Jeff,
I think you may find this article useful:
https://help-2021r2.acumatica.com/(W(22))/Help?ScreenId=ShowWiki&pageid=8285172e-d3b1-48d9-bcc1-5d20e39cc3f0
Please note the following statement there:
Add the Features.xml file to your Visual Studio project in the folder with the same name as the namespace that holds the FeaturesSetExt class (which contains the database extension for the FeaturesSet table). That is, the Feautres.xml file and the FeaturesSetExt class must be in the same namespace.
Hi Dmitrii,
Thank you for your reminding.
I’ve double checked the namespace in both files multiple times and made sure they are the same. But it still doesn’t work properly.