here is my relationship.
Which version of FileMaker are you using?
Your layout would appear to be based on Students.
On which of the 7 table occurrences shown is the portal based? Invoices? Billings? or one of the ones with "Lines" in the name?
It's possible to set up some global fields where you specify the data common to all the new portal records and then a script can loop through your found set of records to create one related record for each using both data from each record in term, (Student_Id) and data from the global fields to create those records.
The best script for that can depend on whether you are using FileMaker 13 or an older version as there's a new type of summary field that can make the script a bit simpler than methods that work with older versions.
I'm using FMp12. The layout is based on Billings, for me to get the _kp_Billing_Id. The portal is based on Billing_Lines which is my Join table.
Sorry, i did not make myself clear on the first post. I add records in the Billing_fees. which is the first filed in the portal. it will automatically populate the other fields. What I need to do is add records for each student on the found set or group like BSHRM with the selected Billing_Lines::_kf_Bill_items_id.
I hope I made myself clearer this time.
Put a button inside your portal row to perform this script. You will select a value for kf_Bill_Items_id in the portal and then click this button in the same portal row to do this:
Set Variable [$Bill_Item ; value: Billing_Lines::kf_Bill_Items_id ]
Omit Record ---> this keeps the current record from getting this item added a second time by the script
go to Record/Request/Page [first]
Set Variable [$BillingID ; value: Billings::kp_Billings_id ]
Go to layout ["Billing_Lines" (Billing_Lines)]
Set Field [Billing_Lines::kf_Billings_id ; $BillingID ]
Set Field [Billing_Lines::kf_Bill_Items_id ; $Bill_Item ]
Go to Layout [Original Layout]
Go to Record/Request/Page [Next ; exit after last ]
Caution: the layout changes in this script can trip any number of scrip triggers that will then pause this script to run the trigger performed script before resuming this script. That interference can keep this script from producing the expected results. There are ways to keep this from happening by setting a global variable to a value and setting up all trigger performed scripts to check for this variable before doing anything.
That works, Thank you very much.