Get Values

General support questions.
PostPosted: Sat Apr 22, 2006 4:40 am
I'm a new user to Filemaker. I have a donations database that has a Donor Table and a Donation Table. When I enter a new donation I'd like the programme to go to the current Donor record, get the ID field value and paste it into a new record in the Donation table.

I'd appreciate any assistance anyone can provide.

Thanks,

Fred
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Sat Apr 22, 2006 8:30 am
< I've moved this from custom functions to general support. >

In most cases, I think you'll want to be entering the donation from the context of the donor's record. That is, you'll be "on" the donor record or will have "selected" the donor record (see my answer to your other post). The point here is that FileMaker needs some context in which to know which donor you intend to use for the donation. Once you have that context, you'd use it to record the donor's ID in the first SetVariable script step below. (This is just an example script showing how you might create a new donation in a new window from the donor's layout.)

Code: Select all
#
#Record the Unique ID of the donor we wish to create a donation for.
#
Set Variable [ $Donor; Value:Donors::Donor ID ]
#
#Navigate to a layout based on the donations table so that we can create a new donation record.
#
Allow User Abort [ Off ]
New Window [ Name: "New Donation"; Top: Get ( WindowTop ) + 40; Left: Get ( WindowLeft ) + 40 ]
Go to Layout [ “Donation Form” (Donation) ]
Show/Hide Status Area
[ Lock; Hide ]
Adjust Window
[ Resize to Fit ]
#
#Create the new record, linking it to our donor.
#
New Record/Request
Set Field [ Donation::Donor ID; $Donor ]
#
#Pause at this layout, allowing the user to edit the donation.
#
Allow User Abort [ Off ]
Pause/Resume Script [ Indefinitely ]
#
#Upon resume script, close window, returning focus to original layout.
#
Close Window [ Current Window ]
John Sindelar
SeedCode

Return to General Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron
(855) SEEDCODE
[email protected]
Follow us: