0
votes

I have a form with 2 grids. I want to display records in second grid(Line grid) according to the selected record in First grid(header grid) i.e, I need to filter records in second grid.. How to do that?? I am using query as a datasource on a form. enter image description here

As shown in figure, there is a common field named Activity number.. Now, I need to display records in Second grid for selected record in first grid(Say VA-00015).

4

4 Answers

3
votes

This is called joined datasources and explained in the link.

If your datasources are based on a query, you are out of luck: the tables are either inner or outer joined, so the usual dynalink logic will not work.

You will have to revert to normal table based datasources.

1
votes

Use the JoinSource, for example you can have 2 datasource SalesTable and SalesLines, the in the details DataSource which is SalesLine set the JoinSource to SalesTable. Now once you click on the SalesTabel grid the SalesLine grid will display the lines for the selected SalesTable, no need for extra code.

0
votes

You need to learn basics of Morph X dev environment, This may help you..

0
votes

If the datasources in a form are based on a query, there is no option available for join datasource and also we cannot add any extra datasource: and the tables are either inner or outer joined. So, better not opt for a query when you need to display data using dynamic linking.

I did the same and took different tables as a datasource instead of a query. Moreover, I have also created two different datasources for a same table which is being used commonly in both Header and Line grids for linking.

FurtherMore, I have joined the datasources a/c to my need. I have also created some display methods for a fields which is being used from different datasource.