I have 3-tables: Company, Contacts , ContactEmail. They are related - Parent, Child, Granchild respectively.
I have a layout based on Company with a portal on the first tab of a tab control listing all Contacts (child) of the Company (parent).
On the second tab I have a notes field for a specific contact (the one selected on tab 1). This is possible because I created a new table occurance of Contacts & a global field in Company (g_SelectedContactID). The Comany table is joined to the new table occurance (ContactsGlobalFilter) via g_SelectedContactID -<-__pkContactID.
There is also a script that triggers on exit of a contact on tab 1: Set Field [Company::gSelectedContactID ; Contact::__pkiContactID].
All of that works without any issues, only because it is what Phil suggested!
Now I want to add some grandchild fields to portal tab#3. Here's what I've done and correct me if it's wrong.
I reated a new table occurance of ContactsEmail & a global field in Company (g_SelectedContactEmailID). The Comany table is joined to the new table occurance (ContactsEmailFilter) via g_SelectedContactEmail -<ContactEmailFilter::__pkContactID.
There is also a script that triggers on exit of a contacts on tab 1: Set Field [Company::gSelectedContactEmail; Contact::__pkContactID].
This works but I've noticed something strange. I placed ContactsEmailFilter::__pkEmailFilterID in the 3rd tab and every time I create a new email message the number increases (as it should). However, when I look in the ContactsEmail table all of the message entries have the same __pkContactEmail ID.
Any ideas on why this is happening? I was expecting that the actual grandchild table would generate a new pk with every new entry but this only happens in the grandchild table occurance.