Display fields in the form, which are choosen by Administrator user.

Hi,   Can I display only the fields in the form which are selected by the administrator in another form.. Let say, I have an entity with 20 attributes(attributes of all types). When admin user logs in, he needs to select the attributes using check boxes and save it. Now when the user opens the original form there should be only fields which are checked by Administrator user. Remaining all will be invisible.
1 answers

Hi Laxman,


The easiest way to achieve this would be to add a boolean isShown attribute for each attribute that you would like to use in your form.  e.g. for attribute FullName you have attribute isShownFullName The administrator can then then set these boolean attributes to true/false with radio buttons or boolean sliders. In your form wrap each attribute in a conditional visibility based on its corresponding boolean attribute. See the screenshot for a demo

Pros: no additional objects or microflows needed.

Cons: you need an extra attribute for each attribute you want to show in your form - memory wise its probably not a concern but it is a lot of work if you want to use this for different entities.


If you don't want to add so many attributes then you would need to use MxModelReflection and a helper object  in order to implement the conditional visibility.


Hope this helps,