Why not specify a sort order that lists the most recently created records at the top of the portal? Then use a button and a script to create a new blank record at the top of the portal instead of just entering the data in the bottom blank add row.
I didn't know that you could make script to add the portal row to the top, I'll have a look at that. I have a button to go to the portal, trouble is I have to portals on the form and sometimes the button goes to the other portal, but not all the time.
The script doesn't actually add it to the top. It adds a new related record and then the specified portal sort order puts it at the top of the portal.
I have a button to go to the portal, trouble is I have to portals on the form and sometimes the button goes to the other portal, but not all the time.
Sounds like you are using go to portal row without first using go to object to place the focus on the correct portal. (You use the name box in the inspector to assign object names to each portal.) This is one of the reasons I avoid the use of Go to Portal Row when it is possible to do so and it is possible in this case:
Say you have these tables, layouts, relationships:
LayoutTable::PrimaryKey = PortalTable::ForeignKey
This script creates a new record in the portal:
Set Variable [ $ID ; value: LayoutTable::PrimaryKey ]
Go to Layout ["PortalTable" (PortalTable) ]
Set Field [PortalTable::ForeignKey ; $ID ]
Go to Layout [Original Layout]
If you have a sort order specified for the portal that puts the most newly created record first, the record created by this script will appear at the top of the portal.
Thanks, it works well. I didn't realise you could name objects, I'm learning all the time at the moment.