How to filter records in line grid based on selected record in header grid?
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. 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).
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.
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.
You need to learn basics of Morph X dev environment, This may help you..
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.
Cancel Sales order packing slip through x++
Transferring open account records between customers
How to make sure that a form is only opened once?
Extend system menu in Dynamics AX 2012?
How to show selected items of certain table on the different table in Dynamics AX 2012?
AllowEdit doesn't work properly in Dynamics AX
AX 2012 how to set args record datasource in X++
Clients seem to be running old (buggy) code after XPO project import
Number sequence AX 2012
SSRS MS words report with page break
How can you get a detailed error descriptions in Dynamics AX?
How to get the length of an array?
X++ loop through lines in grid control
Concatenating row values in x++
How do you access a macro in the AOT macro node?
How can I set the Backgoundcolor of an AX2012 Action Pane Button