Master-Detail Input Parameters
Original Reporter info from Mantis: jzs
-
Reporter name: JZS
Original Reporter info from Mantis: jzs
- Reporter name: JZS
Description:
When a Master-Detail is configured at design time then all of the Detail parameters will be looked up, in order to be fetched, from the Master DB, irrespective of whether some of these parameters' values are going to be supplied by user (or any sort of condition) as input parameters, apart from the Master Table Fields.
Here is a simple scenario:
Master Query:
Select sStoreID, sStoreName from Stores;
Detail Query (linked to Master DataSource):
Select siItemID, siDate, siQty, siStoreID
from StoredItems
where siStoreID = :sStoreID
and siDate <= :StoredDate
In this case, all parameters will be treated as Detail-Filtering params (sStoreID and StoredDate) and their values will be requested from the Master table, once the Master Query is opened (I mean Master Query, even it does not wait to open the Detail Query to evaluate the parameters and revert). And hence the error message pop up saying [Master Table : Field not found : "StoredDate"].
Upon testing in Console there was no issue. Even if the query was populated in GUI at run-time, there will be no issue. The issue only happens when adding the query in the SQL property of the TSQLQuery (Detail Query) at design time.
Steps to reproduce:
Setup any Master-Detail structure (or use the attached sample) and make sure to have at least two parameters in the Detail Query, one for Master-Detail relationship and another one as input parameter to be provided with value at run time to filter the result set of the Detail Query.
PS: Fill the TSQLQuery's SQL property from the Object Inspector in order to reproduce.
Mantis conversion info:
- Mantis ID: 25955
- Version: 1.2.0
- Fixed in version: 3.0.0
- Fixed in revision: 27482 (#9e93e429)
- Monitored by: » jzs (JZS)
- Target version: 3.0.0