Skip to main content
Solved

Show/Hide screens a group of fields based on FeaturesSet


aaghaei
Captain II
Forum|alt.badge.img+10

Hello everyone,

 

I have a few custom forms (new screens) and a set of fields on Acumatica’s standard screens. I have two questions:

  1. how can I set a screen visibility in the site map based on an enabled/disabled feature from FeaturesSet?
  2. I have a set of fields which are repeating on multiple screens. I know I can set their visibility using RowSelected event on each individual screen but I was wondering is there any easier way of setting a group of fields visibility from FeaturesSet or Setup screens rather than doing on each screen?

 

 

Best answer by Dmitrii Naumov

@aaghaei please see here:

https://help-2022r1.acumatica.com/(W(1))/Help?ScreenId=ShowWiki&pageid=8285172e-d3b1-48d9-bcc1-5d20e39cc3f0

 

For features.xml to work you need to do two things:

  1. the file Build Action property  must be set to Embedded Resource in Visual Studio
  2. The path to the file must match the namespace.

In your case you clearly do not have the #2. If your featurex.xml file is in the root of the project, the namespace of the HCLMFeaturesSetExt class must be equal to the project name.

View original
Did this topic help you find an answer to your question?

10 replies

Manikanta Dhulipudi
Captain II
Forum|alt.badge.img+13

Hi @aaghaei Could you please check below article which may help you

Thanks


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • 1196 replies
  • September 12, 2022

@manikantad18 thank you for the link. As I mentioned in my original post, I can do this through RowSelected but I’m looking for possible alternatives that requires less maintenance when I am adding more screens which are using this group of fields


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+6
  • Acumatica Moderator
  • 601 replies
  • September 12, 2022

@aaghaei 

You can use features.xml file and there you can define FieldClass that is hidden by a feature. 

However, I must note that the list of enabled features is controlled by a license. In unlicensed instance you can see all feature switches, but in a licensed instance you only see ones that Acumatica allowed for that particular license key. 

So, if you are going to introduce the custom feature switch, you need to work with your Account Manager to make sure that Acumatica will add the needed feature to the licensing server.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3385 replies
  • September 12, 2022

Hi @aaghaei  Just FYI,  to enable/disable the screens based on the features screen, here is the sample example and it is tied to the license as indicated by Dmitry.

Hope this helps you

https://asiablog.acumatica.com/2021/10/add-new-custom-feature-to-the-enable-disable-features-screen-cs100000.html

 


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • 1196 replies
  • September 12, 2022

 

 

Thank you @Dmitrii Naumov & @Naveen Boga 

 

I followed the instructions and here is the xml file but still the screens are always visible in the site map. What else am I missing? 

 

 

 

 

 

 

 

 


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+6
  • Acumatica Moderator
  • 601 replies
  • Answer
  • September 12, 2022

@aaghaei please see here:

https://help-2022r1.acumatica.com/(W(1))/Help?ScreenId=ShowWiki&pageid=8285172e-d3b1-48d9-bcc1-5d20e39cc3f0

 

For features.xml to work you need to do two things:

  1. the file Build Action property  must be set to Embedded Resource in Visual Studio
  2. The path to the file must match the namespace.

In your case you clearly do not have the #2. If your featurex.xml file is in the root of the project, the namespace of the HCLMFeaturesSetExt class must be equal to the project name.


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • 1196 replies
  • September 12, 2022

Thanks, @Dmitrii Naumov The #1 is now set to “Embedded Resources” and my NS is HCL as you can see below but still doesn’t work. Here is the FeaturesSet extension snippet. Any thoughts on what else could cause the issue? should they both be in the root folder?

 

 


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • 1196 replies
  • September 12, 2022

@Dmitrii Naumov UPDATE: based on the changes you suggested above, now the real data entry screen (HC205000) is showing/hiding properly but the inquiry screens (the other two) always are visible. Any thought?


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • 1196 replies
  • September 13, 2022

@manikantad18 I added the below to my DAC instead of repeating codes in the RowSelected even of each screen. FYI In case you come across a similar case.

 

[PXUIVisible(typeof(Where<Current<HCLSMFeaturesSet.usrHCLAdvanceApprovalWorkflow>, Equal<True>>))]
[PXUIEnabled(typeof(Where<Current<HCLSMFeaturesSet.usrHCLAdvanceApprovalWorkflow>, Equal<True>>))]
 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2722 replies
  • September 14, 2022

Thank you for sharing the additional information with the community @aaghaei !


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings