AnsweredAssumed Answered

Set Field script step problems

Question asked by pnomads on May 6, 2014
Latest reply on May 6, 2014 by pnomads


Set Field script step problems


     I’ll start by saying that I have this script working with all of the functionality that I want by using the “Copy and “Paste” script steps, but I’ve read that this is a cardinal sin in filemaker. So I’m trying to accomplish the same thing by using the Set Field script step, but I’m having trouble getting it to work.


     There are 3 tables involved in this script: Donations, Correspondence, and a join table called PartnerCorrespondence. In plain english, in the Donations table we have a list of all donations from last month and we want to create one “Thank You Note” for this group in the Correspondence table, then take the Unique ID for that “Thank You Note” and apply it to every donor from the last month. Specifically, the script is supposed to:


     1) Create a new record of Correspondence with a unique ID (Correspondence::__pkCorrespondenceID) with “Thank You Note” as the type in the Correspondence table


     2) Then looks at the found set in the Donations table and creates a new record for each donor with its unique ID (Donations::_fkPartnerID) along with the Unique Correspondence ID in the PartnerCorrespondence table 


     With the Set Field rather than Copy and Paste, what it actually does is:


     1) Creates a new record of Correspondence with a unique ID of a “Thank You Note” in the Correspondence table


     2) Creates a new record for each donation in the found set (donations from last month) with all fields blank with the exception of the “PartnerCorrespondence::Notes” field which has the string “For Donation ID “ (it is missing the related data “Donations::DonationID” as well)


     Attached is a screenshot of the script. I’m probably missing something simple, but I just can’t figure this out…thanks for any help!