Multiple findRecord over 3 depending tables

Hi,

I have a form with 4 tables.

  • table1
  • table2 (join on table1)
  • table3 (join on table2)
  • table4 (no joins)

Every table has it’s own grid on the form.

Now I want to click on a button on table4 and want to select a record on table3, depending on what I selected in table4.
My clicked-method looks like:

table1.removeFilter();
table2.removeFilter();
table3.removeFilter();
table1.findRecord(table1::find(table4.id1));
table2.findRecord(table2::find(table4.id1, table4.id2));
table3.findRecord(table3::find(table4.id1, table4.id2, table4.id3));

The problem is that only the first record in table1 is selected and in table2 and table3 only the first record is selected which depends on the prior joining table.

How can I solve this problem in AX4?

I think the problem is table 2 and 3 depends of table1, so if you set record on table1 then you have to do something like table2_ds.executeQuery and how it linked with 1 automatically set on the right record on 2.