Rather than attaching the logging script to a button, you just attach it directly to the field you want to log. A script in the log file creates a new record and triggers the lookup, just like before. There is more fun stuff with Constant relationships, flags, and buttons in the file. In this case the relationship is the opposite way. Then the portal relationship is valid and the buttons appear on all records at once.
Slight variations are possible in portals.
See you next month.