I can't get why are you doing different things than the referred example, mainly using global field.
The example is simple, use field what should be showed unique to relation, then filter with pkey=pkey (GetNthRecord() function may not need).
Thanks for replying user19752,
I hope this helps you help me: basically, the office table has a field which I have marked some records with “YES” in it.
The parent table has a relationship to the office table via a global field with “YES” in it to the “YES” field in the office table.
The portal in the parent table then shows all the records from the office table that have “YES” in this field.
There are often quite a lot of records in the portal and some of the records are offices for the same company.
I want each company to only show once.
It makes sence. You wrote as using global field on both parent and child tables.
relation 1 (not affect for making uniqueness, any relation is ok)
parent::mark = office::mark
office::mark = office2::mark
office::company = office2::company
office::primaryKey = office2::primaryKey