Advice on a method (newbie)

Hi folks,

table A, table B
relation 1-to-any table_A_to_table_B (id_X = id_X)
form A, portal on form B, all in a tabpanel

From form A I’ve to open form B in preview mode (showPrintPreview) and see all records in B joined with A.

I don’t know how create the foundset for the loadRecords, if that is the right direction.
I’ve created the relation any-to-1

table_B_to_table_A (id_X = id_X).

Probably I’ve to use a var Y = table_A.id_X, then make something like

formB.controllers.loadRecords(foundset)

where foundset is something like

select * from table_B where Y = table_B.id_X

Uhmmm … probably I’m confused, but that’s my first solution :P
Any advice will be appreciated
Regards
Andrea

It’s easier than you think. I assume you want the records in the related file to appear in the tab panel. So assuming you have a primary key in the “parent” or left side of the relationship, you just need to match it to one in the related file, i.e. the many (not any) file. So thsi way you will get all the many records that match the one record you have selected. You probably already have all that correct. The trick is that when you place the tab panel, you need to select the relation at the top of the tab panel chooser. That way the tab panel and the fields you put on it will use the relationship you specified. ALso, remember to select the tab panel before adding other fields just to make sure the added fields are based on the relation.