I would like add datasource (table name MyTable) to the form InventTransferJour and show data from MyTable on grid. I added table, set on MyTable joinSource - InventTransferJour - and LinkType - Outer Join- .
I have to add relation in method MyTable.init() - so there should be relation through InventTransferJour.VoucherId = MyTable.VoucherId.
How should I do it please ? How should the code look like ?
You said: “but data in grid are triple times”. But isn’t it a correct result of your join? I don’t know your data, but the most probable explanation is that the code does exactly what you told him to do, regardless that you maybe wanted something else.
I think you’re right. So could you help me with this please?
In the table InventTransferJour are rows with VoucherId:
VC1
VC2
VC3
Now in the table MyTable are three rows with VoucherId:
VC2, some other values
VC2, some other values
VC2, some other values
I would like to do parent/child. So I created new Tabpage on form (InventTransferJour) with grid where should be show data from MyTable. Between InvoiceTransferJour and MyTable doesn’t exist relation on the tables and I have to create relation on the form only.
No. But I changed outerjoin to delayed and I added code to MyTable.init() method () as I wrote previous post, the error message shows:
The data source is not embedded within a (parent) data source.
Links and joins are very different things. If you switch from a join to a delayed link, you can’t use addLink(), because the data source are not in the same query anymore.
But you can use a dynamic link between independent data sources. In your case, the implementation would look something like this: