AnsweredAssumed Answered

newbie scripting problem

Question asked by KBGF75 on Aug 3, 2009
Latest reply on Aug 6, 2009 by KBGF75


newbie scripting problem


My FMP9 file includes a table of Contacts and a table of Donations.  Donation records are related to the donor‘s Contact record by contactID fields (a Donation record’s contactID_fk will always match the Contact record’s contactID_pk).  


My first scripting attempt (ever) has a problem. The concept is to initiate the script while in the Contact record of a particular donor, and the script then finds and sorts related Donation records as follows:

                Step 1:  copy the contents of the contactID_pk field

                Step 2:  go to a donations layout (that contains a contactID_fk field)

                Step 3:  enter the find mode

                Step 4:  go to the contactID_fk field (while still in Find mode)

                Step 5:  paste into that field what was copied in Step 1

                Step 6:  perform the Find (without dialog)

                Step 7:  sort the found records  (by date of donation)


Here are the script steps:

1. Copy [Select; Contacts::contactID_pk]       (select entire contents)

2. Go to Layout [“Donation Data Entry”(Donations)]

3. Enter Find Mode []

4. Go to Field [Donations::ContactID_fk]

5. Paste [Select; Donations::ContactID_fk]   (select entire contents)

6. Perform Find/Replace [No dialog]

7. Sort Records [Restore]

            8. Allow User Abort [On]


When the script runs, it ends in the Find mode for the donations layout. No value has been entered in any field. If I wished, I could continue the find and sort steps manually. Steps 4 and 5 look suspect.  Any advice will be welcome.