I'm having an issue with "Go to related record" script where it's not taking me to the expected set of records.
I have two tables: agendas and items. Agendas can have multiple items and items can exist on multiple agendas. So to support this I created a third table, AgendaItems.
I have two layouts: Agendas (plural) and Agenda (singular). Apologies for the very similar names.
Agendas (plural) is a list-view that displays every agenda as a row. When I click on an agenda I use "Go to related records" to navigate to the Agenda (singular) layout and show only the items for that specific agenda.
Agenda (singular) is a form-view based on the Item table. It contains a portal that displays all items on the agenda. When I click on an item in the portal it shows me the details of that specific item. I'm using a cartesian join to an instance of the AgendaItem's table to accomplish this.
Everything was working great until I tried to put a single Item on multiple Agendas. When I create a second AgendaItem record for an Item the "Go to related records" script stops working as expected.
Specifically, when I try to navigate from Agendas (plural) to Agenda (singular) it takes me to the same set of records each time.
For example, if I click on Agenda A I see items related to Agenda A. But when I click on Agenda B I also see items for Agenda A. If I delete the AgendaItem record that is pointing to an Item for the second time it works again.
What am I doing wrong?