Portals are great, but entering new data in them can be a pain. If you have more items than the portal displays, you have to scroll to the bottom of the portal to get to an empty row. This problem is worse when the portal is sorted. If you're entering data into a portal where the most recent entries are on top, your first reaction after making an entry is to click on the Enter key to see your info sort. But then, of course, you're thrown to the top of the portal and have to scroll down for the next entry. You can get around this by having users enter data into global fields, but this requires a script and an extra button click by the user.
This trick transforms the entry process. The user enters data into fields you can make appear much like the first record of the portal. When he finishes entering, the user can tab out of the field, click away, exit however he likes, and the data automatically appears in the portal while the entry fields are automatically blanked out, ready for another entry. Note: You can place the fields anywhere on the layout, and don't even need the portal to exist; a new related record is created every time a user enters data.
So, what's the trick? You create two relationships to the portal data. One relationship is the normal one that lets portal data be entered and displayed. The second relationship involves the entry fields, and must have the option "Allow Creation of Related Records" checked.
Some definitions:
'Normal' Relationship; fields: 'Link Field [Left]' &
'Link Field [Right]'
'Entry' Relationship; fields: 'Entry Link [Left]' &
'Entry Link [Right]'
The 'Entry Link [Left]' field of the 'Entry' relationship is a calculation field that uses the 'Normal' portal link field ('Link Field [Left]') as the first argument. The formulas presented here work as long as the key is one word (no spaces). You then concatenate a space and a unique identifier that also includes the status function, 'Status(CurrentTime)'. This calculation must have its storage options set to "Do Not Store.'! You can generate this unique identifier many ways, but this one works well:
Formula for 'Entry Link [Left]':
'Link Field [Left] & " " & Status(CurrentTime) &
Status(CurrentDate) & " " & Random'.
Make sure the result is Text. Your goal is to prevent data from accidentally linking up.
Some of the standard ways to create unique links don't apply here. For example, fields such as Creation Date and Creation Time won't ever change for the header data, so using them to create the unique key won't help.
See http://www.semiotics.com/fmdisc.html for Lynn Allen's neat Base62 technique, which you can adapt for this trick.
The 'Entry Link [Right]' field (the right-hand side of the 'Entry' relationship) is a standard Text field.
By including the Status(CurrentTime) in the formula and not storing it, this key regenerates every second. If you put a field from this relationship on your layout and enter data, it generates a new record in the related file keyed to the exact second. When you finish entering data, time has marched on, the relationship has "broken," and the entry fields are ready for a new entry.
So, now you have a new record in the related file with orphaned data. How do you get it into the portal? That's the easy part: Simply set the link field of the normal portal relationship (the 'Link Field [Right]' field) to Auto-Enter the left word of the 'Entry Link [Right]' field. Voilá, your orphaned data is automatically linked and appears in the portal.