If you have this relationship for your layout and portal combination:
Donors::__pkDonorID = Donations::_fkDonationID
Then this will create the new Donation record:
Set Variable [$ID ; value: Donors::__pkDonorID ]
Go to Layout [Donations (Donations)]
Set Field [Donations::_fkDontaionID ; $ID ]
Go to Layout [Original Layout]
But how you set up your portal will determine if the new record appears at the top or bottom of your portal. In either case, use the Name box in the Inspector's Position tab to give your portal an object name.
Go to Object ["portalObjectNameGoesHere" ]
Go to Portal Row [ First ] ---> or last
Go to Field [Specify field in portal row here]
If the new portal record will appear as the last record, you might consider not using a script or button at all. In that case you can specify "allow creation of records via this relationship" and then you can add donations just by going to the botom blank row that this option adds to your portal and start entering data.
Thank you so much. I cannot thank you enough.
Also, and this is a minor point but,
each time I enter in a new donation on my portal, the next row automatically opens up (a new blank row).
I would actually much prefer that it does not do this but that it, instead, opens the new portal row only once I click on "Add a Donation".
Is there an option to get rid of this feature on my table? There doesn't appear to be...
You'll recall that i Mentioned the "allow creation..." option in the underlying relationship? That is the option that is adding this additional blank "add" row and is where you can add a new related record simply by entering data in a field in this row. If you do not want that, you can go to Manage | Database | Relationships and clear that option.