Can you explain what you mean by making this a "batch" process?
The script for creating a single portal record is pretty simple.
Basically I want to create a button which when I click it will add values for the three records (current date, a number for a numerical field, and a Description of the transaction in the Description Field) for all "Members" and "Life Members" in my database.
But I really can't tell what tables and relationships you have. Need to know that in order to spell out the details.
I REALLY appreciate your help here!
Ok, sorry, my brother is helping me here and is explaining a lot to me. He is having the problem at adding a new record in the portal (child? sorry he says he is best at FM7 and recently used 11... 13 is very new to him)
"membership" Database, matched with a portal "dues" to each member... that portal has records for finacial transactions for each member.
Fields included in the portal are: Date, Debit, Credit, Description
The Membership Database has a field in it indicating what type of member they are... depending on their membership status, I want to have a script that will add to EVERY one of those member types a new transaction record in the portal that will have the current date, a 40.00 debit, and a description that says "Yearly Dues"
I hope this was a bit clearer. I hope :)
That helps and the basic method should have worked the same in FMP 7--except that I'll use a variable where I would have used a global field back then so your brother should be able to follow this suggested method:
First, you have relationship linking two tables:
Membership::__pkMemberID = Dues::_fkMemberID
Of course, I don't know the name of the actual tables and fields so you'll have to adjust things to match the table and field names that you actually have.
And you'll have at least one layout based on Membership. That means that there's a layout that shows "Membership" in the "show records from" drop down found in layout setup for that layout. You'll also have one based on Dues unless it was deleted for some reason. You'll need both layouts for this method.
The following script would be run starting on the layout based on Membership:
#First you'll need to perform a find or do a Show All Records to get the set of Membership records for which you want to add this new Dues Record. This can be scripted or done manually. I'm leaving that up to you and starting with the very next step in the script:
Go to Record/Request/Page [first]
Set Variable [$ID ; value: Membership::__pkMemberID ]
Go to Layout ["Dues" (Dues) ]
Set Field [ Dues::_fkMemberID ; $ID ]
Set Field [ Dues::Debit ; 40 ]
Go to Layout [ Original Layout ]
Go to record/request/page [next ; exit after last ]
PS, while I've used the literal value 40, you can improve on the basic idea if you set up a global field with the value of your debit and then refer to that global field in place of 40 in the set field step that assigns the debit value. That way, if you should change your dues in the future, you can edit the value in the global field instead of having to modify this script.
This is amazing. I just spoke to him and he said he feels shameful for not thinking of the call to the portal layout in the first place.
The additional global field is slick, he mentioned he would create an administration layout so I could do things like sort, range find, etc with button scripts that he'll create. We have non-technical users that will need these added as we don't want them fiddling with find and delete all found record type functions.
I'll have him try this and report back with any questions if needed. Once again thanks for your amazing help!