You'd use a script for this.
The details will vary depending on how you specify the precise number of records to create. The following example assumes that gNewRecs, a global number field has had a number entered into it just before the following script is performed. It also assumes the following table occurrence names and relationships:
LayoutTable::FR = PortalTable::FR
Use your actual table and field names in place of mine. A field with global storage specified can be defined in any table in your file and this script will still work so it does not have to be defined in a table named "globals".
Set Variable [$FR ; Value LayoutTable::FR ]
Go to Layout ["PortalTable" (PortalTable) ]
Set Variable [$K ; value: $K + 1 ]
Exit Loop If [ $K > Globals::gNewRecs ]
Set Field [ PortalTable::FR ; $FR ]
Go to Layout [original layout]
But keep in mind that you don't have to use a script to create new records in a portal. If you enable "allow creation of records via this relationship" for PortalTable in the above relationship, you can simply start entering data in the portal and FileMaker will create a new record in the portal table and automatically copy over the FR value to link it to the current record shown on your layout. So you can create portal records very easily on an "as needed" basis without using any script.