It's simple to sort a portal by one of the fields from the table occurrence specified in the definition of the portal. But what if you want to sort by a field several relationships away? For example, say you have a many-to-many relationship from an Invoices table to a Products table with a join table called Line Items. You might want to sort a portal displaying records from the Line Items table on a layout showing records from your Invoices table. If you sort the portal by a field in the Line Items table, it's just a simple point and click.
What if you want to sort by a field from the Products table such as the product name. Typically, the product name isn't pipelined into the Line Items table to conserve space and allow for live updates. To display the product name field in the Line Items portal, all you have to do is select the Products table occurrence and select the product name field. Unfortunately, the ability to select a sort field from a table occurrence other than the one attached to the portal isn't supported in the Portal Setup dialog.
To get around this limitation, temporarily change the table occurrence attached to the portal from Line Items to Products. Next, select the product name field from the sort order. Finally, change the table occurrence in the Portal Setup back to the Line Items table occurrence and your sort field remains the same.