web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

X++ code to set the fields group dynamically in form

(0) ShareShare
ReportReport
Posted on by

Hi All,

1. I have created a form myForm of a tempTable myTable which have 130 fields and 20 fields groups with different fields.

2. Now added all the fields groups in the grid and want 18 fields group to be dynamically visible based on value of one field in the form.

Please guide me to achieve this functionality. 

Thanks in Advance!!

Aimon Fatima

I have the same question (0)
  • Martin Dráb Profile Picture
    236,495 Most Valuable Professional on at
    RE: X++ code to set the fields group dynamically in form

    I wonder how many fields you'll have there, but even if just a single field in each group, eighteen fields sounds like too much for a sigle grid to be useful. I think you should review if your design really leads to good user experiences.

    You can call visible() method on individual form fields, which is a very common technique. I assume you could also set AutoDeclaration = Yes on those groups in the grid and call their visible() methods instead of doing it for individual fields. Simply try it to know it for sure.

  • André Arnaud de Calavon Profile Picture
    299,407 Super User 2025 Season 2 on at
    RE: X++ code to set the fields group dynamically in form

    Hi Aimon,

    I do agree with Martin. Are you intending to have potentially all 130 fields visible on the grid at once? Can you tell a bit more about the business requirement here? Is it to display e.g. transactional data for reporting purposes?

  • Community Member Profile Picture
    on at
    RE: X++ code to set the fields group dynamically in form

    Yes Martin, I have set AutoDeclaration = Yes for all fields groups and I have different no. of fields in the field group.

    Okay, the requirement is myForm is called from a parent form mainForm where it has a field "A" which is a Lookup of tableA which have 7 enum fields A1,A2,A3,A4,A5,A6,A7 with value All, Half and one. 12 fields for ALL, 6 for half and 1 field for one should be visible according to the selected enum value.

    So for 7 enum fields with 3 different scenario which make total of 121 fields and have 18 different fields group with all scenario separately.

    eg: created 3 different FieldGroups of A1  for 12 fields , 6 fields and 1 fields, and same for all other fields

    On form only 1 scenario will be fulfilled, so for that case I have to call corresponding field groups which I have created for that combination at time.

  • Gao Lu Wang Profile Picture
    180 on at
    RE: X++ code to set the fields group dynamically in form

    Hi Aimon,

    If my understanding is right, you need to put 7*3=21 field groups in the grid. In the extreme scenario you have to make 12*7=84 fields to display in the grid.

    As Martin and André mentioned, the grid should not hold too many fields. I think it really has bad affect on the performance .

    Customer may no need to see all fields in the grid,can most fields be put  in detail form than the list?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,933

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 793 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 537 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans