whereParameters
The whereParameters property in a business record relation defines the relationship between two business records.
The whereParameters property defines a list of parameter-value pairs. In each pair, the parameter is the field from the child record and the value is the field from the master record. In many instances, the parameter-value pair reflects the foreign key-primary key relationship of the tables from which the business records are derived, where the parameter specifies the foreign key field and the value specifies the primary key field.
The parameter-value pair is used to create the filter in the WHERE
clause of the
SQL query used to fetch the data. For example, if the parameter is orders.userid
and the value is account.userid
, the SQL filter becomes WHERE
orders.userid=account.userid
.
While most records use a single parameter-value pair to define the relationship, some records require multiple parameter-value pairs to define the relationship. This would be necessary between records whose underlying tables use composite keys to define their primary-foreign key relationship. A relationship can add as many parameter-value pairs as needed to clearly define the relationship.