Is it possible to dynamically change fields visible property in Business Central

Hi Experts,

Is it possible to dynamically change the fields visible property based on some boolean selection?

I have a scenario that in user setup I have a boolean field lets say “Hide Field”

If “Hide Field” is true then I have a (for eg) In Customer Card Name field will be hidden for some specific user? and this should be configurable for some other table and for any field?

I was trying to achieve this using fieldref but fieldref does not have visible property,any%20table%20in%20the%20database.

Table Name Field Name Hide Values
Customer Name TRUE
Vendor Name TRUE
Item Unit Cost TRUE

Any suggestion?

Thank you

You need to use the visible property of the field controls of your page objects. Not in the tables.

Thanks Erik. Is there any way that I can configure dynamically for different pages. just want like a control center where if I define a field for a page, that field should not be visible?

Not sure what you mean by “a control center”? If you think of standard functionality without any coding, then no! But you can create page extensions where you can change it.

Control center means I have a Custom page (Control) where I can select any base page along with field, and on that custom page I have boolean field “Hide Values”

so If “Hide Values” is True for a particular field then that field will be hidden on selected base page

Custom Page(Control)

Page Name Field Name Hide Values

Customer Card Balance True

If “Hide Value” true then Balance field will not be visible for some user.

I am trying my best to explain this. I agree that for achieving this I need to do some coding.

Once again Thank you Erik for your time.

Theoretically then you could do it. But it would be the biggest and most breakable app ever created! [emoticon:f395e0ed7f2b4f71a3a75ca0fa47590c]

You would have create a visible variables for all page field controls. And then you would have to create a Control function to all pages to set the variables based on the data in your “Custom Page”.

But don’t do it, even if you could. You would end up with something that would require so many exceptions to avoid users hiding required fields etc.

To me, then it sounds like you are trying to make something, which exists. It’s just called page customizations!

Thanks Erik. I agree with your suggestion.

Thanks a lot.