Do you want to prevent the creation of records with duplicate values or just the display of records with duplicate values?
I just want to display the record without duplicate values.
I will assume for the sake of these examples that you are preventing display of records with duplicate values in a single field.
There are two methods that I know that still use a portal. There are other alternatives that dispense with using a portal altogether such as a Single field using ExecuteSQL to list the data that I will not describe in this particular post.
a) Set up another table where the unique values have been eliminated. That would be a lot of work just to list unique values, but then, in many cases, such a table is useful in its own right as a tool for better managing the same data so it is an option to consider.
b) Set up a self join between the portal's table occurrence and another occurrence of the same table. This method requires a primary key field in the portal's table that uniquely Identifies each record in that table.
Say that you have this relationship to start:
LayoutTableOccurrence::PrimaryKey = PortalTO::ForeignKey
Duplicate the PortalTO occurrence and set up this relationship:
PortalTO::foreignKey = PortalTODupFilter::foreignKey AND
PortalTO::FieldWithDups = PortalTODupFilter::FieldWithDups
Then use this portal filter expression to drop out duplicates:
PortalTO::PrimaryKey = PortalTODupFilter::PrimaryKey
How it works:
All the Records in the Portal's table with the same ForeignKey and FieldWIthDups values will match to the same record in PortalTODupFilter. Only one of those will have the same PrimaryKey (being the very same record on both sides of the relationship) and thus only that one instance of that value appears in the portal.
a little bit difficult to understand but I'll try your solution.
Feel free to ask follow up questions on any part of that replay where things are not clear.