Hello all,
I have a portal that displays contracts for clients. I figured out how to sort it so the newest contract would be on top and all the rest flow down in descending order. The problem I have, is I want the ability to add a new contract at the top instead of scrolling all the way to the bottom. An empty row there would be the best.
Note: The way I got this to sort descending, is I created a ContractID serial number. Filled in the serial numbers, then sorted descending in Portal Setup.
There is a technique for achieving this which I learned some time ago from someone on this forum (can't remember who, sorry, otherwise I could acknowledge them), but it goes like this:
1. Set the existing portal relationship to NOT allow creation of records. Sort this portal with most recent records at top.
2. Make a duplicate of the relationship to ALLOW creation of records.
3. Duplicate your existing portal, make it just a single row, and switch it to the new relationship, the one that allows creation of records.
4. Place this portal directly above the main portal on your layout, so it almost appears to be part of the main portal
5. Filter this portal using IsEmpty ( <portalTO::primaryKey> ) so that it contains only a single blank row. To create a record, just enter the data; as soon as you click outside the record the filter will remove this record and it will appear as the top row of the portal below, with a new blank row in the data entry portal.
The two screenshots below show this in Layout and Browse modes deployed in a timesheet setup.