Hi Vahid and Anton,
Thank you for the quick answer!
The system clears at the moment of adding a new datasource when the initial query has some joined tables in it (independent of who added them - the user / or the developer).
In other words - if the query Q is based only on 1 table: A (with some ranges on the A table specified by the user), than adding via the above x++ code - a notexisting-join N to A, the construction works and the query looks OK. But if the query is already a join of 2 or more tables - e.g.: (root A -> child B -> child C))) (e.g. CustInvoiceJour with child SalesTable with child CustTable) - then trying to add a join of table N to the root A (a non-existing in this case, but the type seems not to matter) fails - and this is happening at the moment of adding new data source with addDataSource(N) - the initial query clears.
So - it is not clear to me how can someone add 2 data sources - both joined to the root table - if the adding of the second one clears the query.
What I would like to achieve is the following:
The initial query is something like:
select CustInvoiceJour where ... some ranges specified by the user
join SalesTable where SalesTable.SalesID == CustinvoiceJour.SalesID
&& ... some other ranges specified by the user
join CustTable where CustTable.AccountNum == SalesTable.InvoiceAccount
&& ... some other ranges specified by the user
This query is stored with .pack() into a table field. Later, I need to take this query and add to it the following condition to the root table:
notexists join NSNProcessedTable where NSNProcessedTable.CustInvoiceJour == CustInvoiceJour.RecID
&& NSNProcessedTable.WorkID == SomeWorkId.
If the original query consisted only of the root table (CustInvoiceJour) - then the adding of the notexists-join works fine, but if it consisted of a join of some tables - than at the moment of adding the new data source for NSNProcessedTable - it clears :(
Thank you and kind regards,
Nikolay