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.