Field Not Found error with master detail link when changing SQL

I am changing to remote db (TxDataSet) and I have a form that dynamically changes master - detail SQL's, this was working with FIB components. For example if I have master SQL as "select ordernumber as Order_Number from salesorders" and detail SQL as "select linecode from saleslines where ordernumber = :Order_Number" and have a datasource linked to master dataset and datasource property of the detail dataset set to master datasource. This works fine and uses the master ordernumber to set the detail ordernumber parameter automaitcally. Now if I close both datasets and change both SQL's to "select invoicenumber as Invoice_Number from salesinvoices" and detail SQL as "select linecode from salesinvlines where invoicenumber = :Invoice_Number"
then open master dataset I get error field "Order_Number" not found. Seems the datasource datalink fieldnames is not being cleared either when dataset is close or SQL is changed.

To workaround it I have added the line below

procedure TBaseXDataset.MasterDisabled(Sender: TObject);
FDataLink.FieldNames := ''; //added this line
if Params.Count = 0 then

Anyone have any ideas? is it a bug or am I missing something?

It's a bug, we fixed it this internally. Next release will include the fix.
We sent you a patch in private message, please confirm if it solves the issue, thank you.

Unfortunately it did not solve the problem, are you able to look into it further please

In this case, can you please provide a full project (that we can compile and run at our side) that reproduces the issue? Might be a specific situation.

I have emailed you a project that shows this issue and the other two I recently created

Thanks, but I haven't received the e-mail so far.

I have sent in a message instead

1 Like

Thank you, received.

Thank you for the report and the demo reproducing the issue (sent in private).
We were able to reproduce and fix the problem. Next version will include the fix.