SQL expression elements
Your database administrator will have detailed information about the SQL expression elements that are useful in your unique system. The DBLookup filtering SQL expressions have these elements:
- sourceType
- String, required - DataSource type:
- SQL: Requires SQL SELECT statement.
- REGISTERED: Requires the name for the builder class that is registered in the application registry path /system/rowsource/builders.
- sourceKeyField
- String, optional - key field name. Default: first field. This value is the underlying data value to store in the relevant database field.
- sourceLabelField
- String, optional - label field name. Default: second field. This field should populate the label of the DBLookup in the DBLookup’s closed or default state.
- sourceDisplayFields
- String, optional - a pipe separated list of popup display fields. Default: all except first field. The fields to display to the user when the DBLookup is in the expanded state.
- Source
- String, required - DataSource specification:
- SQL: Requires a SQL statement.
- REGISTERED: Requires the name for the builder class that is registered in the application registry path /system/rowsource/builders.
The source expression element is code that tells the system from which tables to extract the primary and secondary input data and where to locate the data to display in the filtered secondary DBLookup. In this example, the Job DBLookup is filtered by the Project DBLookup:
source='SELECT DISTINCT JOB.JOB_ID, JOB_NAME, JOB_DESC, MYPROJ_NAME AS PROJECT FROM JOB, DEPT_PROJ_JOB WHERE DEPT_PROJ_JOB.JOB_ID=JOB.JOB_ID'
- primaryInputFields
- Enables a primary-secondary relationship between fields. Specifies names of input fields narrowing down the current field's set of values.
- primaryDataFields
- Enables a primary-secondary relationship between fields. Specifies names of data fields narrowing down the current field's set of values.
- multipleRowPrimarySecondary
- Set to true or false. Default is false.