How to get the index of the link to another table
Let's say I have a table of Invoices and then a table of payments. Each invoice is an aggregate of payments i.e. one invoice can have multiple payments. How can I get the index of each payment in the list of the invoice?