Set Selection Group

The Set Selection Group system function enables you to group together fetching criteria; this is the only characteristic of this system function that makes it different from the Set Selection system function. If you are not familiar with the Set Selection system function, please review the Grid Control System Functions section in the Form Design Aid guide.

The following three examples describe how Set Selection and Set Selection Group perform, and illustrate the differences in their functionality.

The result is that all employee records with the name ABC and all customer records are fetched.

Examples

Example 1: Set Selection

A form has a filter field called Alpha Name (ALPH), which is associated with the Alpha Name column in the F0101 table. In addition, there are two Set Selection system functions under the Find Button Clicked event. These two system functions are as follows:

  • Set Selection (FC Grid,F0101,AT1,<equal>,'E',<AND>)

  • Set Selection (FC Grid,F0101,AT1,<equal>,'C',<OR>)

AT1 is the Search Type column in table F0101. Value 'E' is for Employee and value 'C' is for Customer.

When a user enters ABC in the filter field and then clicks the Find button, the following conceptual WHERE clause is created:

WHERE ALPH=ABC AND AT1=E OR AT1=C

Example 2: Set Selection Group

A form has a filter field called Alpha Name (ALPH), which is associated with the Alpha Name column in the F0101 table. In addition, there are two Set Selection Group system functions under the Find Button Clicked event. These two system functions are as follows:

  • Set Selection Group (FC Grid,F0101,AT1,<equal>,'E',<AND>)

  • Set Selection Group (FC Grid, F0101,AT1,<equal>,'C',<OR>)

AT1 is the Search Type column in the F0101 table. Value 'E' is for Employee and value 'C' is for Customer.

When a user enters ABC in the filter field and then clicks the Find button, the following conceptual WHERE clause is created:

WHERE ALPH=ABC AND (AT1=E OR AT1=C)

The result is that all employee and all customer records with the name ABC are fetched.

Example 3: Set Selection and Set Selection Group

A form has a filter field called Alpha Name (ALPH), which is associated with the Alpha Name column in the F0101 table. In addition, there are two Set Selection system functions and two Set Selection Group system functions under the Find Button Clicked event. These four system functions are as follows:

  • Set Selection (FC Grid,F0101,AN8,<greater than>,'100',<AND>)

  • Set Selection Group (FC Grid,F0101,AT1,<equal>,'E',<AND>)

  • Set Selection (FC Grid,F0101,AN8,<less than>,'200',<AND>)

  • Set Selection Group (FC Grid,F0101,AT1,<equal>,'C',<OR>)

AN8 is the Address Number column in the F0101 table; AT1 is the Search Type column in the F0101 table. Value 'E' is for Employee and value 'C' is for Customer.

When a user enters ABC in the filter field and then clicks the Find button, the following conceptual WHERE clause is created:

WHERE ALPH=ABC AND AN8>100 AND AN8<200 AND (AT1=E OR AT1=C)

The result is that all employee and all customer records with the name ABC and address number in the range of 100 to 200 are fetched.

Although shown in this example, the usage of mixed Set Selection and Set Selection Group is not a good practice. The purpose of this example is to show the runtime behavior - Set Selection Group system functions are grouped and appended to the WHERE clause at the end.