Toby, sounds like you're talking about the new record portal at the end of your portal list being at the top instead of at the bottom? There's no option in Filemaker to do that but you can get the same effect by using 2 different portals with the top one being only 1 row high and the bottom portal showing all your related records.
- Create a calculation field in your child table, we'll call it ChildIDcalc here. Basically what you need to achieve is that the calculation field = the child relationship ID up to the point when you are done entering data into the new record. I'm not familiar with your database so I can't say exactly the best way to achieve this. The safest way is to simply use If (IsEmpty(YourField1) and IsEmpty(YourField2) and IsEmpty(YourField3) [.....and so on] ; YourChildRelationshipID ; "")
- Create a second instance of the child table and create a relationship between the parent table and the new child table instance where, YourParentRelationshipID = ChildIDcalc. Enable creation of portal records in the child table through this relationship.
- Open the relationship for your existing portal and uncheck allow creation of records.
- Go to your parent table layout and create a new single row portal just above the existing portal with records from the relationship you just created. Add, size and format the portal fields as per the portal below.
Now you should be able to create a new record in the new portal and as soon as the data in the fields meets the conditions of the ChildIDcalc field, the relationship will be broken and you can enter another new one. As the relationship in the bottom portal is unaffected by any of this each new record should be sorted according to your prescribed sort order.
I haven't done this for about 11 years and I'm just typing this out from memory so forgive me if I've left anything out. I know it works though as I used to use this concept way back then.
There are a couple of techniques you could implement here, but a quick and easy way would be to have a button near the portal for creating a new related record and have that button go to portal row last.
Duplicate your portal. Filter the second one to show only the empty record. Then put it anywhere you want.
Filter it like:
IsEmpty ( portal_relationship::id )
Ahh, I gotta catch up! Never used to have filters in portal setup. That is much simpler