Field Subsets

 

Field subsets is a mechanism which allows you to define one or more subsets of fields within a repository structure, and then generate code based on a subset of the structure which contains only the fields that have been declared as a member of that subset.

To declare that a field is a member of a subset, add text like the example below to the fields user text string:

@SUB=name;

Where "name" is the name of the subset that you wish to define. For example, if you wish to create a subset called "COMBO" in a structure, and have that subset contain two fields, then you would add this text to the user text string for both of those fields:

@SUB=COMBO;

Once you have a subset defined, you can cause CodeGen to include only the fields in that subset by using the -subset command line option. For example:

codegen -t DataClass -s CUSTOMER -subset COMBO

Field Subsets From Multiple Structures

If you want to be able to process a subset of fields from multiple structures then you can combine the -ms command line option with the -subset command line option.

Command Line Subsets

Another way to define a subset of fields to be processed is to use the -fields command-line option. With this option you can name the fields that you want to be part of the subset directly on the command line, without the need to modify the repository. For example:

codegen -t DataClass -s CUSTOMER -fields FIELD1 FIELD2 FIELD3

Command Line Subsets With Multiple Structures

It is also possible to specify a subset of fields when processing multiple structures. For example, you could use a command like this:

codegen -t DataClass -s STR1 STR2 -ms -fields STR1.FIELD1 STR1.FIELD2 STR2.FIELD1 STR2.FIELD2

Video

Using Field Loop Subsets

 

 

 


Copyright © 2021  Synergex International, Inc.