0 votes

Hello,

I wish I could condition the display of fields in a category based on the value of a field of another category of the same table.

Would you have an idea of ​​the feasibility of it and how?

thank you in advance

Michael

asked in Efficy/ Client side by (127 points)

1 Answer

0 votes

Category tables are an instrument to store multiple "categories" of records in the same entity (=not the same table).

E.g. companies entity could have a two categories supplier and customer with each their
own set of fields. A company can be none of these, can be one off, or both be customer and supplier.

What I want to say is that it's a bad design to filter a field from category customer based on category supplier because the category is not guaranteed to be activated. Also table rights are important when you work with categories.

Technically and functionally, doing this kind of configuration is discouraged.

answered by (7.4k points)
Hi Kristof

in my case, I have 2 category by default in "Project" entity .

Category A : a category with imput field

Category B : a read-only category with display parameter (checkbox) for each fields present in category A. Fields in this category are a copy from Product category fields.

I wish I could hide (or not) each imput field in category A by the checkbox value for the field defined in category B

if my explanation in English is not clear then I make french ;-)

regards

Michael
Default activated categories for all users is again a bad design. If the category always has to be active, the fields should have been added to the main table. Unless the security of the fields is different compared to the main table.

Anyway, if you switch to use "forms" to display the content of categories instead of the classical (2012) fixed position layout, you can control serverside the display of fields in the FormFieldsEditCustom.txt.

There are many steps to take, too much to document quickly
I can't use "forms" because i have 65 fileds in Category A and the best display for user is by clasical view...
You can hide the field from being generated serverside in the <%GetCategoryContents%> macro. There is a hide property.

Then you append serverside the custom HTML for the fields you want to conditionally show or hide. To get the x-y-z position, you could optionally query SysFields.
not possible to do that by customizing fonction "GetCategoryContents" ?
no, there is no support for that
Sorry, I did not understand everything, but I'll watch.

Where can I find the <%GetCategoryContents%> macro ?
In MacroEdit.txt, macro TabContentCategories
1,248 questions
1,518 answers
1,858 comments
328 users